Sign in to follow this  
ZealousEngine

Possible to render to a 3D texture?

Recommended Posts

ZealousEngine    100
Is it possible to render to a 3d texture (using directx9)? Or perhaps some way to render each slice to a traditional 2d render target, then somehow combine those slices (efficiently) into a 3d texture? Thanks for any info!

Share this post


Link to post
Share on other sites
Hodgman    51324
I'm not sure about DX9, but it's possible in GL to use a particular "slice" of a 3d texture as a render target:
Quote:
A particular image of a texture object is selected for use as a
framebuffer-attachable image by specifying the mipmap level, cube
map face (for a cube map texture), and z-offset (for a 3D texture)
that identifies the image.

Share this post


Link to post
Share on other sites
the Dx9 docs show that

IDirect3DDevice9::CreateVolumeTexture(...)

has the "DWORD Usage" parameter like any other texture..normally you set that to D3DUSAGE_RENDERTARGET.

However, it also says this:
"Usage can be 0, which indicates no usage value. If usage is desired, use D3DUSAGE_DYNAMIC or D3DUSAGE_SOFTWAREPROCESSING."

I would take that to mean that other Usage values are not allowed... But you can always try it and see.

It may be you have use something like D3DXLoadSurfaceFromSurface to achieve what you want (but this is too slow to be used in realtime).

It does seem odd that that cant create a volume texture as a render target.

Share this post


Link to post
Share on other sites
AverageJoeSSU    564
The Nvidia OpenGL SDK 10 has an example of rendering 3d droplets to a 3d texture on a cube. I believe that has what you are looking for. I'm not sure if the DX10 SDK has anything like that... it might though.

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