Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Mi Mai 15, 2024 01:03

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Autor Nachricht
BeitragVerfasst: So Jul 29, 2007 12:44 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
This question is more of a high-level OpenGL question than trying to answer a specific coding type question. I wondered if anyone had any thoughts on my question about PoT textures.

I have loads of video files that are playable with HMusicCenteXin (the OpenGL version of HMusicCentre) and their thumbnails get displayed in the user interface so a user can choose and play them. These videos are all in 720x576 resolution, and so are their thumbnails (as I just took a single frame grab when the video was playing one time) that my project displays.

I have just written a little Delphi utility that will load in my .JPG images and will allow me to frame relevant parts of them and then save the cropped areas as another .JPG - the width and height choices are all power of two, i.e 32x32 up to 512x512 and any combination thereof, i.e. 128x256.

Bild

I, myself, am only interested in the square textures and my default would be 256x256. My question is all about how OpenGL uses these textures. I am displaying the 720x576 textures fine right now - they look good and load in quite quickly - but I'm sure there's other stuff going on in the background, in the innards of OpenGL.

My question is whether it is worth me cropping all of my 720x576 images down to either 512x512 or 256x256? Will OpenGL use a lot less memory for these (apart fom the fact that you'd expect it to anyway) because it likes PoT textures much better than, say, 720x576... what does OpenGL really do with a 720x576 texture - does it create a 1024x1024 texture internally, or a 1024x512 texture and add some pixels on the X and remove some pixels on the Y?

Also, if my textures are PoT textures - will performance benefit because OpenGL has to do less with the textures as they are being loaded?

So - should I go ahead and convert all my 720x576 video thumbnail images to PoT sized images?

BTW... I don't know if anyone would find this a useful utility; it's obviously dead simple and I'm 100% sure that folk have other utilities they use to do this kind of thing, but the offer is there if anyone wants it.

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Zuletzt geändert von dpm_dpmartin am So Jul 29, 2007 13:33, insgesamt 1-mal geändert.

Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Jul 29, 2007 13:29 
Offline
DGL Member
Benutzeravatar

Registriert: Do Dez 05, 2002 10:35
Beiträge: 4234
Wohnort: Dortmund
POT and NPOT: At first one thing. If you are using the gluBuildMipMaps2D function you allways will get POT textures because the glu function allways scale the given texture to POT.

And else the distriction between POT and NPOT results from older hardware. Former the hardware only supports POT because easier handling for the cards. And NPOT is supported since opengl reached the 2.0 core (or the extension GL_ARB_texture_non_power_of_two). This means new hardware will support NPOT.

Internally NPOT texturen are stored like the comparable bmps. Opengl dosn't change any of the texture (instead of some strange formats). Thats the reason why NPOT isn't backward compatible. If you try to load an NPOT on older hardware you won't get any texture. You only get white planes.

Performance: If you are using NPOT with automatic generated mipmaps and AMD/ATI cards (Radeon 9x00) the driver will switch in software mode. It's terrible slow. I don't know if newer cards (X1000 X2000) had the same problems. Else the only changes will result from the bandwidth. But i think in your application it's not an problem. More important for games.

I would test if NPOT are supported and if not i would convert this to POT and use them. But the Files an you Harddisk i would let in 720x576. If the graphic card is updated the images automatically will be in better quality. But if NPOT are not supported the loading time is higher than you are writing the converted images back to disk.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Jul 29, 2007 13:52 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jan 24, 2007 00:44
Beiträge: 144
Did a simple test... not very scientific at all, but the results seem interesting... I ran my program and then went to the same Artist, an Artist with 2 Video thumbnails and checked the amount of RAM that Windows Task Manager said the program was using - I could do this in code I guess, but here are the results:

When these thumbnail textures were 720x576 .jpg files, the amount of RAM being used was 62,804K.
When one of these thumbnails was 512x512 and one was 256x256, the amount of RAM being used was 60,416K.
When both of these thumbnails were 256x256 in size, the amount of RAM being used was 59,720K.

As I say, it's not very scientific, and who knows what Windows really reports, but it lends some credence to the theory I guess.

I don't think I need to care about losing quality of the displayed images, because they'd never really take up more than 300x300 pixels on the screen anyway and I'm not getting into scaling these images, I'm cropping them out of the 720x576 images.

_________________
Cheers, DpM
http://www.hmusiccentre.org.uk


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 3 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 2 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.067s | 17 Queries | GZIP : On ]