RGBA vs single/dual component textures

This topic contains 4 replies, has 3 voices, and was last updated by  zmippie 6 years, 9 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #30401

    zmippie
    Member

    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.

    #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! 😉

    #34645

    zmippie
    Member

    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.

    #34646

    Xmas
    Member

    Is this compared to GL_RGBA/GL_UNSIGNED_BYTE? What is your test case exactly? Are you using ES1.1 or 2.0?

    #34647

    zmippie
    Member

    Is this compared to GL_RGBA/GL_UNSIGNED_BYTE?

    Yes.

    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).

Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.