Pergunta

I have texture, loaded from a .DDS file using the method D3DX11CreateTextureFromFile(). The DDS is created using Block Compression 1 compression, so when I query IDXGISurface1 from the ID3D11Texture2D, the pixel format of the surface is DXGI_FORMAT_BC1_UNORM.

So my question is: can I change (convert) the format of the surface to DXGI_FORMAT_B8G8R8A8_UNORM. I tried ID3D11DeviceContext::CopyResource method but it seems it is unable to convert from BC1 to 32bppBGRA.

Any suggestions are appreciated.

Foi útil?

Solução

If this is a one-time or build-time process, use the TexConv tool included in DirectXTex. If you need to do this at run-time, you can either render the image to a B8G8R8A8 render target, or use the CPU conversion code included in the DirectXTex library.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top