Browse Source

Merge pull request #15185 from WestLangley/dev-background_frag

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

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

@@ -4,6 +4,11 @@ varying vec2 vUv;
 
 
 void main() {
 void main() {
 
 
-	gl_FragColor = texture2D( t2D, vUv );
+	vec4 texColor = texture2D( t2D, vUv );
+
+	gl_FragColor = mapTexelToLinear( texColor );
+
+	#include <tonemapping_fragment>
+	#include <encodings_fragment>
 
 
 }
 }