在 GL ES 2.0 函数中, texture2DLod在片段着色器中不可用。我需要移植 GLSL 着色器。
在 GL ES 2.0 我只能使用texture2D (sampler2D sampler, vec2 coord, float bias )
告诉我如何计算与已知值LOD(详细程度)相当的偏差值?
//Example GLSL:
float lod=u_lod;
textureLod(sampler, (uInverseViewMatrix * vec4(r, 0.0)).xy, lod);
//I need GL ES 2.0:
float lod=u_lod;
float bias=? <-----calc bias from lod
texture2D(sampler,(uInverseViewMatrix * vec4(r, 0.0)).xy,bias)