Sign in to follow this  

Possible to render to a 3D texture?

Recommended Posts

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


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

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