Browse Source

Merge pull request #15186 from WestLangley/dev-cube_frag

Cube Shader: Support decoding, tone mapping, and output encoding
Mr.doob 6 years ago
parent
commit
76ae97a02d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/renderers/shaders/ShaderLib/cube_frag.glsl

+ 6 - 1
src/renderers/shaders/ShaderLib/cube_frag.glsl

@@ -6,7 +6,12 @@ varying vec3 vWorldDirection;
 
 void main() {
 
-	gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
+	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
+
+	gl_FragColor = envMapTexelToLinear( texColor );
 	gl_FragColor.a *= opacity;
 
+	#include <tonemapping_fragment>
+	#include <encodings_fragment>
+
 }