Should I always use the GL_ARGB format for all textures in OpenGL?

This bothered me a bit ... and it is really hard to see any difference in performance, so I ask here:

If my images do not use the alpha channel, should I use "GL_RGB" to store them in the memory of the GFX or "GL_ARGB" card, as if it were faster when processing from its full 32-bit block?

Or do GFX cards automatically convert 24-bit images to 32-bit images to increase their rendering time?

Edit: I have no performance issues, but I just want to do it in the best way! I also want the program to look good on older graphics cards that don't need to optimize things like new cards.

+3
source share
2 answers

Choose the format that matches your texture data and let the video driver worry about the details. Do not try to outwit him. OpenGL implementations are pretty well optimized and will make all the necessary decisions to achieve the best performance, whether it is converting all textures to 32bpp or some other internal format.

If you find that you have performance problems, use a tool like gDEBugger to identify performance bottlenecks. It is very unlikely that your texture format would be such a bottleneck.

: - , , . . , ( ) .

+2

Source: https://habr.com/ru/post/1750914/


All Articles