Sign in to follow this  
ozkill

Is impossible to make DXT1 Render Target?

Recommended Posts

ozkill    107
Hi. Sorry for my poor english.

I try to make Render Target for DXT1 format.

[code]pD3DDevice->CreateTexture( 512, 512, 1, D3DUSAGE_RENDERTARGET, D3DFMT_DXT1, D3DPOOL_DEFAULT, &pTexture, NULL)[/code]

but It not work. show error message as:

[code]Direct3D9: (ERROR) :Invalid format specified for texture[/code]


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 :-)

Share this post


Link to post
Share on other sites
Evil Steve    2017
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:
[code]
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
}
[/code]

Share this post


Link to post
Share on other sites
ankhd    2304
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.

Share this post


Link to post
Share on other sites
MJP    19788
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.

Share this post


Link to post
Share on other sites

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