未验证 提交 b98fa585 编写于 作者: W WestLangley 提交者: GitHub

Merge pull request #22318 from Mugen87/dev6

PMREMGenerator: Remove calls of convertSRGBToLinear().
......@@ -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();
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册