Sign in to follow this  

Mipmapping

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

How would a renderer typically decide which mipmap level to use based on distance? I know from implementation to implementation and across different renderers methods may differ, but I tried searching on Google, and came up with nothing but the theory of it.

Share this post


Link to post
Share on other sites
I think I might have a faint idea based on the little that I've found. Basically an iterative process of checking to see if the step between texels is greater than 1.0, and if so, drop a mipmap level, divide step by two, until <= 1.0

Share this post


Link to post
Share on other sites
Have a look at the ddx/ddy HLSL intrinsic functions.

If you were going to manually choose a mip-level in a shader, you could use them to see how much difference there is between the UVs at the current pixel, and the UVs of neighbouring pixels. You could then use this information to see how many texels will be "lost in-between" that 2x2 block of pixels, and choose a mip level that corresponds to that amount of loss.

This is efficient on GPUs because they usually don't process a single pixel at once, they work on blocks of pixels in parallel.

Share this post


Link to post
Share on other sites
In addition, mipmapping was just a speed optimization, it is far from delivering the correct result. That's why there is no "right" way to select the mipmap level.
And that's also why you have instructions in pixelshaders to select a mipmap if the default 2x2 approximation does not fit your needs.

There are some renderer (even on console) that select mipmaps by distances, like you said, they have additionally a "bias" value that is based on the polygon-plane-area and texelcount covered by it.

Share this post


Link to post
Share on other sites

This topic is 2812 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this