I see that e.g. in OpenGL it is possible to create a back buffer with an alpha channel (RGBA8888). What's the effect/advantage over having an RGB888 back buffer?

  • \$\begingroup\$ It's actually very likely that RGB888 is actually a RGBA8888 buffer. as it's cheaper to access data that's aligned to 4 byte boundaries. \$\endgroup\$ Feb 11 '17 at 1:02

You can use the destination's alpha (backbuffer) as a factor in blending functions such as GL_DST_ALPHA and GL_ONE_MINUS_DST_ALPHA.

This, among other things, lets you do front-to-back transparency/blending.

On some platform this also lets you have transparent windows and overlays that use the front buffer's alpha value.

  • \$\begingroup\$ That means until I need these special use cases, I can initialize my back buffer without alpha channel? \$\endgroup\$
    – tyrondis
    Feb 10 '17 at 1:57
  • 2
    \$\begingroup\$ If you want. It should work either way. A lot of GPU drivers will use 32bits either way due to memory alignment constraints. \$\endgroup\$ Feb 10 '17 at 2:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.