How does opengl decide which mip level to use?

大憨熊 提交于 2019-12-10 21:18:41

问题


The question is fairly self explanatory. I'm asking in terms of using texture coordinates that could have come from anywhere (a uniform, a varying, another texture fetch).

Say for example I do a texture fetch on a mipmapped (or anisotropically filtered) texture, and I use the square of a varying which was set in the vertex shader. I assume that glsl cannot determine the derivative of an arbitrarily complex function like this, so how does it know which mip level to use?

Thanks.


回答1:


It is usually using spatial coherence. It computes the same value on a block of at least 2x2 pixels, and computes the discrete difference between the neighbors. That's enough of an approximation for the derivative.



来源:https://stackoverflow.com/questions/1523488/how-does-opengl-decide-which-mip-level-to-use

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!