Ver Fonte

#8445 Fix Errors in Tone Mapping Demo

Mugen87 há 9 anos atrás
pai
commit
786ed7f2d9

+ 1 - 1
examples/js/postprocessing/AdaptiveToneMappingPass.js

@@ -186,7 +186,7 @@ THREE.AdaptiveToneMappingPass.prototype = {
 			this.previousLuminanceRT.dispose();
 
 		}
-		var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBFormat };
+		var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat };
 
 		this.luminanceRT = new THREE.WebGLRenderTarget( this.resolution, this.resolution, pars );
 		this.luminanceRT.texture.generateMipmaps = false;

+ 1 - 3
examples/js/shaders/GammaCorrectionShader.js

@@ -34,13 +34,11 @@ THREE.GammaCorrectionShader = {
 
 		"varying vec2 vUv;",
 
-		THREE.ShaderChunk[ "common" ],
-
 		"void main() {",
 
 			"vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );",
 
-			"gl_FragColor = vec4( linearToOutput( tex.rgb ), tex.a );",
+			"gl_FragColor = LinearToGamma( tex, 2.0 );",
 
 		"}"