How does opengl decide which mip level to use?

The question is pretty clear. I ask in terms of using texture coordinates that could come from anywhere (homogeneous, variable, different texture selection).

Say, for example, I sample a texture on a mipmapped (or anisotropically filtered) texture, and I use the square of the variable that was set in the vertex shader. I suppose glsl cannot determine the derivative of an arbitrarily complex function like this, since it knows which mip level to use?

Thanks.

+3
source share
1 answer

Spatial coherence is commonly used. It calculates the same value on a block of at least 2x2 pixels and calculates the discrete difference between neighbors. This is enough to approximate the derivative.

+5
source

Source: https://habr.com/ru/post/897020/


All Articles