Sign in to follow this  
ozkill

Is impossible to make DXT1 Render Target?

Recommended Posts

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

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