Is impossible to make DXT1 Render Target?

Started by
4 comments, last by ozkill 13 years ago
Hi. Sorry for my poor english.

I try to make Render Target for DXT1 format.

pD3DDevice->CreateTexture( 512, 512, 1, D3DUSAGE_RENDERTARGET, D3DFMT_DXT1, D3DPOOL_DEFAULT, &pTexture, NULL)

but It not work. show error message as:

Direct3D9: (ERROR) :Invalid format specified for texture


Is impossible to make DXT1 Render Target?
I want to save Render Target image to file as DXT1 format.
Waht can i do?

May the force be with you :-)
Advertisement
It depends on your graphics card, but I'd be surprised if any graphics card supports a DXT format render target.

You can find out what render target formats the graphics card supports by looking at the caps viewer that comes with the SDK, or with IDirect3D9::CheckDeviceFormat:

D3DFORMAT adapterFormat = D3DFMT_X8R8G8B8; // Display mode format
D3DFORMAT rtFormat = D3DFMT_DXT1; // Render target format
if(FAILED(pD3D->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, adapterFormat, D3DUSAGE_RENDERTARGET,
D3DRTYPE_SURFACE, rtFormat))
{
// Format not supported
}
oops did a quick post and neaver show it work and then reposted sorry its late..

Hi.

Do what Steve said and then create a render target(Supported type)then render your scene and next save that to a texture as a DXT1 texture.
You can't render to DXT1 (or any other block compressed format) on any GPU. In DX10 and DX11 you can do the compression manually in a shader and then have the device treat it as block-compressed format when sampling, but that's about it.
thank you all !!!!!!!

god bless you

This topic is closed to new replies.

Advertisement