Browse Source

Shaders: Simplify envmap encoding logic (#22233)

* Clean up

* Simplify encoding logic
WestLangley 4 years ago
parent
commit
d7601e1137
1 changed files with 2 additions and 6 deletions
  1. 2 6
      src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js

+ 2 - 6
src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js

@@ -38,6 +38,8 @@ export default /* glsl */`
 
 		vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
 
+		envColor = envMapTexelToLinear( envColor );
+
 	#elif defined( ENVMAP_TYPE_CUBE_UV )
 
 		vec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );
@@ -48,12 +50,6 @@ export default /* glsl */`
 
 	#endif
 
-	#ifndef ENVMAP_TYPE_CUBE_UV
-
-		envColor = envMapTexelToLinear( envColor );
-
-	#endif
-
 	#ifdef ENVMAP_BLENDING_MULTIPLY
 
 		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );