From 0d9045fb81f5bd00a27f1c43fda53e23dd534715 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Sat, 14 Aug 2021 00:42:03 -0700 Subject: [PATCH] Remove conversion to RGBE color because it happens in the shader (#22327) --- src/extras/PMREMGenerator.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/extras/PMREMGenerator.js b/src/extras/PMREMGenerator.js index dc7bc5c740..f5231d6604 100644 --- a/src/extras/PMREMGenerator.js +++ b/src/extras/PMREMGenerator.js @@ -99,17 +99,6 @@ const _axisDirections = [ * https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view */ -function convertLinearToRGBE( color ) { - - const maxComponent = Math.max( color.r, color.g, color.b ); - const fExp = Math.min( Math.max( Math.ceil( Math.log2( maxComponent ) ), - 128.0 ), 127.0 ); - color.multiplyScalar( Math.pow( 2.0, - fExp ) ); - - const alpha = ( fExp + 128.0 ) / 255.0; - return alpha; - -} - class PMREMGenerator { constructor( renderer ) { @@ -298,9 +287,6 @@ class PMREMGenerator { backgroundMaterial.color.copy( background ); scene.background = null; - - const alpha = convertLinearToRGBE( backgroundMaterial.color ); - backgroundMaterial.opacity = alpha; useSolidColor = true; } @@ -308,9 +294,6 @@ class PMREMGenerator { } else { backgroundMaterial.color.copy( _clearColor ); - - const alpha = convertLinearToRGBE( backgroundMaterial.color ); - backgroundMaterial.opacity = alpha; useSolidColor = true; } -- GitLab