Explorar o código

Correct equirectangular UV mapping formula

WestLangley %!s(int64=8) %!d(string=hai) anos
pai
achega
0ca979ab32
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/renderers/shaders/ShaderChunk/lights_pars.glsl

+ 1 - 1
src/renderers/shaders/ShaderChunk/lights_pars.glsl

@@ -263,7 +263,7 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
 		#elif defined( ENVMAP_TYPE_EQUIREC )
 
 			vec2 sampleUV;
-			sampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );
+			sampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
 			sampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;
 
 			#ifdef TEXTURE_LOD_EXT