Browse Source

Merge pull request #8450 from Mugen87/tonemapping

Fix Errors in Tone Mapping Demo
Mr.doob 9 years ago
parent
commit
39ff01e5e0

+ 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 - 5
examples/js/shaders/GammaCorrectionShader.js

@@ -28,19 +28,15 @@ THREE.GammaCorrectionShader = {
 
 	fragmentShader: [
 
-		"#define GAMMA_FACTOR 2",
-
 		"uniform sampler2D tDiffuse;",
 
 		"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, float( GAMMA_FACTOR ) );",
 
 		"}"