2
0
Эх сурвалжийг харах

Merge pull request #22318 from Mugen87/dev6

PMREMGenerator: Remove calls of convertSRGBToLinear().
WestLangley 4 жил өмнө
parent
commit
b98fa58548

BIN
examples/screenshots/webgl_furnace_test.jpg


+ 3 - 3
examples/webgl_furnace_test.html

@@ -72,7 +72,7 @@
 
 				// camera
 
-				camera = new THREE.OrthographicCamera( frustumSize * aspect / - 2, frustumSize * aspect / 2, frustumSize / 2, frustumSize / - 2, 1, 30 ); 
+				camera = new THREE.OrthographicCamera( frustumSize * aspect / - 2, frustumSize * aspect / 2, frustumSize / 2, frustumSize / - 2, 1, 30 );
 				camera.position.set( 0, 0, 10 );
 
 			}
@@ -110,14 +110,14 @@
 				return new Promise( function ( resolve ) {
 
 					const envScene = new THREE.Scene();
-					envScene.background = new THREE.Color( COLOR ); // sRGB colorspace assumed, apparently
+					envScene.background = new THREE.Color( COLOR );
+					if ( renderer.outputEncoding === THREE.sRGBEncoding ) envScene.background.convertSRGBToLinear();
 
 					const pmremGenerator = new THREE.PMREMGenerator( renderer );
 					radianceMap = pmremGenerator.fromScene( envScene ).texture;
 					pmremGenerator.dispose();
 
 					scene.background = new THREE.Color( COLOR );
-					if ( renderer.outputEncoding !== THREE.sRGBEncoding ) scene.background.convertSRGBToLinear();
 
 					resolve();
 

+ 2 - 2
src/extras/PMREMGenerator.js

@@ -296,7 +296,7 @@ class PMREMGenerator {
 
 			if ( background.isColor ) {
 
-				backgroundMaterial.color.copy( background ).convertSRGBToLinear();
+				backgroundMaterial.color.copy( background );
 				scene.background = null;
 
 				const alpha = convertLinearToRGBE( backgroundMaterial.color );
@@ -307,7 +307,7 @@ class PMREMGenerator {
 
 		} else {
 
-			backgroundMaterial.color.copy( _clearColor ).convertSRGBToLinear();
+			backgroundMaterial.color.copy( _clearColor );
 
 			const alpha = convertLinearToRGBE( backgroundMaterial.color );
 			backgroundMaterial.opacity = alpha;