Jump to content
  • Advertisement
Sign in to follow this  
51mon

Traverse mipmap tree

This topic is 4347 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 using a mipmap chain as a tree structure. I traverse it recursively; but here I got a problem. How much should I offset the texture coordinate for every step down the tree. I guess this picture explains it better than my words: I'm working in directx so top-left is the filling convention. The texture coordinates goes from 0-(HalfPixel-FLT_MIN) to 1+HalfPixel and each coordinate has the range (HalfPixel >= Coordinate > -HalfPixel), the number of pixels in each level is power of two. The dimension of the top level texture (the leaf nodes) is 1024x1024 so I need 9 different offsets. Maybe someone know some article that talks about this subject? (I think I got all the numbers right)

Share this post


Link to post
Share on other sites
Advertisement
If you're storing all of your images in one texture (i.e. with a single mip level), it will depend on the arrangement that you have chosen, but gnerally you divide your local texture coordinates (i.e. where 0-1 spans the current mip level) by two, and offset by the dimension of your current mip level.

If you're using *real* mipmapping (i.e. with an attachment surface chain), then simply use LOD bias to traverse to different levels without having to change your texture coordinates at all.

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!