Skip to content

Commit

Permalink
Update envmap_fragment.glsl
Browse files Browse the repository at this point in the history
Per #11367 (comment)
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.
  • Loading branch information
NNskelly authored Jun 14, 2017
1 parent ab6a66f commit a40bb34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderers/shaders/ShaderChunk/envmap_fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit a40bb34

Please sign in to comment.