Jump to content
  • Advertisement
Sign in to follow this  

LockBox() with volume textures of non-power-2 dimensions

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

I'm working with a GeForce 6800 Ultra and I've run into difficulties generating volume textures properly. According to the texture caps for the card, the maximum volume extent is 511 and it allows non-power-of-two sized textures. However, it seems that internally it is actually using a 512x511xDepth block of memory when I use a 511x511xDepth size texture. First, I create a 511x511xDepth texture object. Next, I use LockBox(), specifying a box and array ranks with the same dimensions. I fill this array and call UnlockBox(). When the texture is rendered, it is skewed as if each row contained 512 pixels and I had written contiguous rows of 511 (each subsequent row is offset by one less than the previous). I tried using the LockedBox out parameter in LockBox(). In my case (2 bytes per pixel), the box it returns has row pitch of 1024 (512*2) and slice pitch of 523264 (row pitch * 511). I could use that information to adjust what I lock. So the question is, how can I know what is stored before the call to LockBox()? If there is not a better way, I guess I can just call LockBox() just to get the pitch information before the texture is actually generated. Any notes or suggestions are appreciated.

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!