|
@@ -17623,19 +17623,19 @@ function WebGLPrograms( renderer, cubemaps, extensions, capabilities, bindingSta
|
|
|
|
|
|
let encoding;
|
|
|
|
|
|
- if ( ! map ) {
|
|
|
-
|
|
|
- encoding = LinearEncoding;
|
|
|
-
|
|
|
- } else if ( map.isTexture ) {
|
|
|
+ if ( map && map.isTexture ) {
|
|
|
|
|
|
encoding = map.encoding;
|
|
|
|
|
|
- } else if ( map.isWebGLRenderTarget ) {
|
|
|
+ } else if ( map && map.isWebGLRenderTarget ) {
|
|
|
|
|
|
console.warn( 'THREE.WebGLPrograms.getTextureEncodingFromMap: don\'t use render targets as textures. Use their .texture property instead.' );
|
|
|
encoding = map.texture.encoding;
|
|
|
|
|
|
+ } else {
|
|
|
+
|
|
|
+ encoding = LinearEncoding;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
return encoding;
|
|
@@ -23724,9 +23724,17 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
// Clearing
|
|
|
|
|
|
- this.getClearColor = function () {
|
|
|
+ this.getClearColor = function ( target ) {
|
|
|
+
|
|
|
+ if ( target === undefined ) {
|
|
|
+
|
|
|
+ console.warn( 'WebGLRenderer: .getClearColor() now requires a Color as an argument' );
|
|
|
+
|
|
|
+ target = new Color();
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- return background.getClearColor();
|
|
|
+ return target.copy( background.getClearColor() );
|
|
|
|
|
|
};
|
|
|
|
|
@@ -48296,6 +48304,7 @@ const ENCODINGS = {
|
|
|
|
|
|
const _flatCamera = /*@__PURE__*/ new OrthographicCamera();
|
|
|
const { _lodPlanes, _sizeLods, _sigmas } = /*@__PURE__*/ _createPlanes();
|
|
|
+const _clearColor = /*@__PURE__*/ new Color();
|
|
|
let _oldTarget = null;
|
|
|
|
|
|
// Golden Ratio
|
|
@@ -48501,7 +48510,7 @@ class PMREMGenerator {
|
|
|
|
|
|
const outputEncoding = renderer.outputEncoding;
|
|
|
const toneMapping = renderer.toneMapping;
|
|
|
- const clearColor = renderer.getClearColor();
|
|
|
+ renderer.getClearColor( _clearColor );
|
|
|
const clearAlpha = renderer.getClearAlpha();
|
|
|
|
|
|
renderer.toneMapping = NoToneMapping;
|
|
@@ -48550,7 +48559,7 @@ class PMREMGenerator {
|
|
|
|
|
|
renderer.toneMapping = toneMapping;
|
|
|
renderer.outputEncoding = outputEncoding;
|
|
|
- renderer.setClearColor( clearColor, clearAlpha );
|
|
|
+ renderer.setClearColor( _clearColor, clearAlpha );
|
|
|
|
|
|
}
|
|
|
|