Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

2D texture format DXGI_FORMAT_B8G8R8A8_UNORM

$
0
0
Hi,
I just begin to learn DirectX11. I am confused about  the format of a 2D texture.
For example:    
// Create the texture t
        CD3D11_TEXTURE2D_DESC textureDesc(
            DXGI_FORMAT_B8G8R8A8_UNORM,
            m_textureWidth,
            m_textureHeight,
            1,
            1,
            D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET
        );
        m_deviceResources->GetD3DDevice()->CreateTexture2D(&textureDesc, nullptr, &m_texture);
 
What does DXGI_FORMAT_B8G8R8A8_UNORM mean? I check the MSDN document. It is a four-component, 32-bit unsigned-normalized-integer format that supports 8 bits for each color channel and 8-bit alpha? Does it mean there are four components and each component has 8 bits? But how to use just 8 bits to represent a float type in range [0, 1.0]?
 
Thanks.
 
YL

Viewing all articles
Browse latest Browse all 17560

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>