未验证 提交 0d9045fb 编写于 作者: G Garrett Johnson 提交者: GitHub

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

上级 b98fa585
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册