Jump to content
  • Advertisement
Sign in to follow this  
PAiNIC

Updating a volume texture

This topic is 4774 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible under DX9 to copy the contents of a 2D texture into a 'slice' of a 3D Volume texture?

Share this post


Link to post
Share on other sites
Advertisement
I'll answer this question myself for the sake of future searches.
In the current version of DX9, the ONLY way to get data from a 2d surface to a 3d surface is to lock both surfaces and copy the data directly. This usually involves creating a system-memory copy of the volume texture (as only Dynamic/Managed/System memory Textures can be locked, and due to the size of volume textures creating one with any of these flags is not recommended) and copying the data into that, then copying that texture across to graphics hardware for rendering.

Needless to say this is slow and nasty. If you really want to use a volume texture-based effect (especially such as myself where I needed to copy the rendertarget data into the volume texture) it is best to instead create a stack of 2d textures representing each depth slice and manage them yourself.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!