Jump to content
  • Advertisement
Sign in to follow this  
antber

OpenGL how the filtering between mip levels

This topic is 2233 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 dont quite understand whats happening when we are trying to interpolate between miplevels only using glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR);

there is paragraph 3.8.9 in OpenGL 2.1 specs that says:

Finally, there is the choice of c, the minification vs. magnification switchover point. If the magnification filter is given by LINEAR and the minification filter is given by NEAREST_MIPMAP_NEAREST or NEAREST_MIPMAP_LINEAR, then c = 0.5. This is done to ensure that a minified texture does not appear “sharper” than a magnified texture. Otherwise c = 0.[/quote]

The simple test which draws 8x1 texture quad into 7x1 viewport with min filter set as above shows that results really depends from the GL_TEXTURE_MAG_FILTER setting as well.
I dont also understand how the texture might get "sharper" neither I can calculate manually the results of the interpolation.
With switching point set to 0.5 the magnification takes place when LOD < 0.5 where LOD calculated as lg of the scale factor.
So that LOD for the test = lg(8/7) = 0.19, which is less than 0.5, so that magnification takes place instead of minification (wtf?)
Shouldnt we get base level values (without any interpolation) in the framebuffer as the magnification always takes reference values from the base level?

Share this post


Link to post
Share on other sites
Advertisement
The simple test which draws 8x1 texture quad into 7x1 viewport with min filter set as above shows that results really depends from the GL_TEXTURE_MAG_FILTER setting as well.[/quote]
FYI, that is magnification, your image is bigger than the viewport, so it is zoomed in or magnified.

This is done to ensure that a minified texture does not appear “sharper” than a magnified texture. Otherwise c = 0.[/quote]
Minified means it is rendered smaller, or in 3d further away. Since the texture is downsampled, the pixels average down over and over, so you will end up with more blurry images.

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!