Skip to main content
gamedev.net
🔒 Locked

BackBuffer Format

Started by Kambiz 5 replies 3.5k views
Original Post
Kambiz
Kambiz
What is the difference between X8R8G8B8 and A8R8G8B8 ?
Mushu
Mushu
One has an alpha channel (the A8R8G8B8) the other does not. But backbuffers don't need an alpha channel (since there's no point in storing alpha values) so stay with X8R8G8B8 since it'll take up less space

edit: I'm an idiot lolz.
Aldenar
Aldenar
With the A8R8G8B8, you have a valid alpha channel. With the X8R8G8B8, the "X" channel is ignored and not accessible to do stuff.

Having an alpha channel in the back buffer allows you to use that channel as a mask for special operation (For example, alpha blending using D3DBLEND_DESTALPHA to only display something where alpha was previously set).

Edit: Mushu, both formats are 32 BPP so I doubt that X8R8G8B8 will take less memory
centipede
centipede
Quote:
Original post by Mushu
stay with X8R8G8B8 since it'll take up less space.

Actually they both take the same amount of space (32 bits per pixel), but in X8R8G8B8 8 bits are left unused.
andhow
andhow
Quote:
But backbuffers don't need an alpha channel (since there's no point in storing alpha values)

not quite. your render target (front buffer) doesn't use an alpha, which is why the only allowed D3DFORMATs do not have alpha, but back buffers can and do use alpha. several of the device render states provide different primitive operations you can do using the destination alpha provided by the back buffer.
And how!
Aiursrage2k
Aiursrage2k
Quote:

D3DFMT_A8R8G8B8 32-bit ARGB pixel format with alpha, using 8 bits per channel.
D3DFMT_X8R8G8B8 32-bit RGB pixel format, where 8 bits are reserved for each color.

BackBuffer or Display Formats
These formats are the only valid formats for a back buffer or a display.

Format Back buffer Display
A2R10G10B10 x x (full-screen mode only)
A8R8G8B8 x
X8R8G8B8 x x
A1R5G5B5 x
X1R5G5B5 x x
R5G6B5 x x

It seems like D3DFMT_A8R8G8B8 can only be used in the backbuffer... where X8R8G8B8 can work for both...


Quote:

Note that formats are supplied by independent hardware vendors (IHVs) and many FOURCC codes are not listed. The formats in this enumeration are unique in that they are sanctioned by the runtime, meaning that the reference rasterizer will operate on all these types. IHV-supplied formats will be supported by the individual IHVs on a card-by-card basis.

Thats intresting.
Insufficent Information: we need more infromationhttp://staff.samods.org/aiursrage2k/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.