views:

103

answers:

2

This has been bothering me a while... and it's really hard to really see any difference in performance, so i ask here:

If my images doesnt use alpha channel, should i use 'GL_RGB' for saving them in GFX card memory, or 'GL_ARGB' as if that would be faster in processing since its full 32 bit block?

Or does GFX cards automatically convert 24 bit images into 32 bit images to boost their rendering times?

Edit: I have no performance issues, but i just want to do it the best way! I also want to ensure that the program renders good on old graphics cards that doesnt necessary optimize things as good as new cards.

+2  A: 

Choose the formats appropriate for your texture data, and let the video card driver worry about the details. Don't try to outsmart it. OpenGL implementations are quite well-optimized and will make all of the necessary decisions for you for the best performance, whether that means converting all textures to 32bpp or some other internal format.

If you find that you're having performance issues, use a tool like gDEBugger to work out your performance bottlenecks. It's highly unlikely that your texture format is such a bottleneck.

Edit: If the problem is simply memory pressure, then you have too many textures that are too large. Simple as that. Use compression, use lower-quality (fewer bits per channel) textures, or use smaller textures.

greyfade
Well, the reason why i am asking this is that i am going to run out of memory, and most of my textures doesnt even use alpha channel.
Newbie
Make textures smaller. Use larger versions when you know you have enough video memory available and smaller versions for smaller cards. Another thing you can do is enable compression for a small quality tradeoff.
greyfade
Thats not what im asking here... Why should i make worser texture quality if i could just drop the alpha channel? So i am asking do i get performance problems if i use RGB instead of ARGB... read my edits
Newbie
All I can suggest is try it, profile it, and find out. Every card is different, and any answer I could give will be wrong.
greyfade
I would try it if i had all the cards in the world...
Newbie
I would suggest using the RGB format if you have memory issues. As greyfade wrote above, OpenGL will do the necessary optimizations.
PeterK
+1  A: 

If memory usage is your concern, try texture compression:

It's hard to give general advice which one to use. Try those which are applicable to your texture format (RGB textures don't work with RG compression) and have a good look at the resulting visual quality.

Malte Clasen
Its also worth noting that compressed textures will chew through less upload bandwidth to the card and then less bandwidth when used for rendering. All round they are a much better choice than ARGB or RGB provided they don't mess the image up too much!
Goz
Well, my images are low resolution already, i dont want to mess them up at all
Newbie
They are very unlikely to make much noticable difference if the hardware is good at decompressing.
Goz