Jump to content
  • Advertisement
Sign in to follow this  
sofakng

Should I have an XRGB or ARGB backbuffer format? (newbie question)

This topic is 3995 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm a newbie to graphics programming and I'm confused on backbuffer formats. Should I be using A8R8G8B8 or X8R8G8B8? My DirectX wrapper (Asphyre v4.1 for Delphi) seems to default to X8R8G8B8 but I think that might be because my video card doesn't support A8R8G8B8 for the backbuffer (if that's possible). Also, if I use X8R8G8B8 for the backbuffer, wouldn't that prevent me for drawing alpha-blending shapes? Thanks for your help!

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by sofakng
Also, if I use X8R8G8B8 for the backbuffer, wouldn't that prevent me for drawing alpha-blending shapes?
Only if destination alpha is important to your chosen render operation. Most examples use Src_Alpha:Inv_Src_Alpha but you really should use One:Inv_Src_Alpha - neither of which actually use alpha information stored in the destination texture/backbuffer...


hth
Jack

Share this post


Link to post
Share on other sites
So, most often the backbuffer is X8R8G8B8?

Suppose I wanted to create an "alpha mask" for drawing textures? I guess I would need an ARGB render target or hope that my video card supports A8R8G8B8 backbuffers? ...or is this possible to do with my X8R8G8B8 backbuffer?

If A8R8G8B8 backbuffers aren't commonly supported (and my alpha-mask won't work on XRGB) then maybe I need a render target anyways...

Share this post


Link to post
Share on other sites
Most often I use XRGB. Sometimes I have found that this format could cause errors when working with alpha. When I export maps from photoshop to DX10 for example I need to use ARGB. You could take a look in caps viewer following the SDK and see what your hardware support. If I do remember right I have never had problems when renering to surfaces other that the backbuffer when it comes to alpha.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!