Sign in to follow this  

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

This topic is 3776 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
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

This topic is 3776 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this