浏览代码

PMREMGenerator: Remove calls of convertSRGBToLinear().

Mugen87 4 年之前
父节点
当前提交
42ad7c81ac
共有 2 个文件被更改,包括 4 次插入5 次删除
  1. 2 3
      examples/webgl_furnace_test.html
  2. 2 2
      src/extras/PMREMGenerator.js

+ 2 - 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,13 @@
 				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 );
 
 					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;