Răsfoiți Sursa

Remove conversion to RGBE color because it happens in the shader (#22327)

Garrett Johnson 4 ani în urmă
părinte
comite
0d9045fb81
1 a modificat fișierele cu 0 adăugiri și 17 ștergeri
  1. 0 17
      src/extras/PMREMGenerator.js

+ 0 - 17
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;
 
 		}