提交 a40bb34e 编写于 作者: N NNskelly 提交者: GitHub

Update envmap_fragment.glsl

Per https://github.com/mrdoob/three.js/issues/11367#issuecomment-308303716
Equirectangular U sampling update to intuitively equiangular-per-raster sampling.

A quick visual test shows no change from the old version, which worries me a bit, since I'm not getting the trig-on-paper to give identical results.  If the math DOES work out provably identically, the original version is certainly more efficient.
上级 ab6a66f4
......@@ -30,7 +30,7 @@
#elif defined( ENVMAP_TYPE_EQUIREC )
vec2 sampleUV;
sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );
sampleUV.y = asin( flipNormal * reflectVec.y) * RECIPROCAL_PI + 0.5;
sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;
vec4 envColor = texture2D( envMap, sampleUV );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册