mipmap level selection

How does OpenGL know which mipmap level to use? Asked another way, given the three vertices of a triangle (including texture coordinates), the mipmap dimensions, the modelview and projection matricies (and whatever else you might need), how would I figure out which mipmap level to use?

Is it standardized in any way, or is it implementation dependent? Does it matter how much of the texture subimage is used?


There is a formula given in the spec. It’s a function of the derivatives of the texture coordinates in screen space.

However, implementations can choose to approximate the formula. There are certain bounds on this approximation.

  • Matt