Jump to content
  • Advertisement
Sign in to follow this  
warmsun

A question about the mipmap

This topic is 2692 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

hi,everyone! I have a question about the mipmap . when a texture(256*256) is map to a 128*256 rectangle of pixels in screen . which level will the directx will adopt? 128*128 or 256*256?

Share this post


Link to post
Share on other sites
Advertisement
It depends on the filtering mode you've selected for D3DSAMP_MIPFILTER. If you're using D3DTEXF_POINT it will select whichever texture level is nearest on a per-pixel basis, if you're using D3DTEXF_LINEAR it will use a weighted average of the two. Anisotropic filtering (Google is your friend) complicates things a little bit more, but that's the basics of it.

Share this post


Link to post
Share on other sites
For the u, the one pixel match two texel..and for the v ,one pixel match one pixel..So, if we are using D3DTEXF_POINT ,which level is the nearest?

Share this post


Link to post
Share on other sites
In many instances, the filtering should not be uniform in each direction (it should be [color="#0645ad"]anisotropic, as opposed to [color="#0645ad"]isotropic), and a compromise resolution is used. If a higher resolution is used, the [color="#0645ad"]cache coherence goes down, and the aliasing is increased in one direction, but the image tends to be clearer. If a lower resolution is used, the cache coherence is improved, but the image is overly blurry, to the point where it becomes difficult to identify.[/quote]
This quote is form wikipedia's Mipmap article. It seems these is a chose to decide which is the nearest level

Share this post


Link to post
Share on other sites
For POINT and LINEAR, the largest gradient in the U or V direction is used for selecting the mipmap. So in your case it will sample from the second mip level, since the gradient of your U coordinate is larger than for the V coordinate and exactly matches the size of the second mip level (which will be 128x128). For ANISOTROPIC, it will take two samples from the 0th mip level.

This is a pretty good explanation of mip level selection, which you can read if you're interested.

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!