提交 9362babd 编写于 作者: G Garrett Johnson

Fix PMREMGenerator not resetting the clear color when scene.background is a color

上级 f62c3df3
......@@ -22,6 +22,7 @@ import { PerspectiveCamera } from '../cameras/PerspectiveCamera.js';
import { RawShaderMaterial } from '../materials/RawShaderMaterial.js';
import { Vector2 } from '../math/Vector2.js';
import { Vector3 } from '../math/Vector3.js';
import { Color } from '../math/Color.js';
import { WebGLRenderTarget } from '../renderers/WebGLRenderTarget.js';
const LOD_MIN = 4;
......@@ -52,6 +53,7 @@ const ENCODINGS = {
const _flatCamera = /*@__PURE__*/ new OrthographicCamera();
const { _lodPlanes, _sizeLods, _sigmas } = /*@__PURE__*/ _createPlanes();
const _clearColor = /*@__PURE__*/ new Color();
let _oldTarget = null;
// Golden Ratio
......@@ -257,7 +259,7 @@ class PMREMGenerator {
const outputEncoding = renderer.outputEncoding;
const toneMapping = renderer.toneMapping;
const clearColor = renderer.getClearColor();
_clearColor.copy( renderer.getClearColor() );
const clearAlpha = renderer.getClearAlpha();
renderer.toneMapping = NoToneMapping;
......@@ -306,7 +308,7 @@ class PMREMGenerator {
renderer.toneMapping = toneMapping;
renderer.outputEncoding = outputEncoding;
renderer.setClearColor( clearColor, clearAlpha );
renderer.setClearColor( _clearColor, clearAlpha );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册