Possible to render to a 3D texture?

Started by
2 comments, last by AverageJoeSSU 15 years, 8 months ago
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!
Advertisement
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.
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.
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.

------------------------------

redwoodpixel.com

This topic is closed to new replies.

Advertisement