- December 21, 2010 at 10:09 am #30401
Can anyone hazard a guess why my tests on an iPad show that using GL_RGBA textures perform significantly better than the same textures in GL_ALPHA or GL_LUMINANCE format?
I assumed that because of the reduced memory bandwidth of the single-component texture formats, they’d be faster, but my tests contradict that. Could the overhead of constructing the RGBA pixel from the single components be a factor that slows these textures down?
Thanks for any insights.
PS. Sorry for x-posting this from gamedev.net, but I couldn’t really get a satisfactory answer there.December 21, 2010 at 12:47 pm #34644
I guess most GPUs are optimized for (mipmapped) GL_RGBA textures. Some GPUs might implement GL_ALPHA and GL_LUMINANCE textures simply by using one channel of a RGBA texture plus some additional conversion; this way the OpenGL specification can be implemented with a minimum of additional silicon and programmers usually don’t care because they don’t use GL_ALPHA nor GL_LUMINANCE textures.
Look at the bright side: instead of a GL_ALPHA texture you can use a GL_RGBA texture with three more channels without performance penalty! 😉December 21, 2010 at 12:59 pm #34645
Look at the bright side: instead of a GL_ALPHA texture you can use a GL_RGBA texture with three more channels without performance penalty! 😉
Yes, I guess you’re right. It takes more diskspace and texture memory (if single component formats would be stored internally in a single component format) and possibly more time to upload GL_RGBA images, but runtime performance takes precedence.
I’d still love to know what really goes on on the PowerVR chips with these single component formats though, just out of curiosity.January 4, 2011 at 4:02 pm #34646
Is this compared to GL_RGBA/GL_UNSIGNED_BYTE? What is your test case exactly? Are you using ES1.1 or 2.0?January 4, 2011 at 4:19 pm #34647
Is this compared to GL_RGBA/GL_UNSIGNED_BYTE?
What is your test case exactly? Are you using ES1.1 or 2.0?
I have a huge number of slowly rotating (but flat) meshes on the screen and I test with different texture types/blend settings (the iOS devices can’t keep their framerates up, but I look at the achieved framerates and compare those). I can clearly see that the PVRTC variants are the winners, but I had expected the single-component texture formats to also benefit from the reduced memory bandwidth. This is all OpenGL ES 1.1 (using VBO’s).