|
@@ -1,9 +1,9 @@
|
|
import DataMap from './DataMap.js';
|
|
import DataMap from './DataMap.js';
|
|
-import { Color, Mesh, SphereGeometry, BackSide } from 'three';
|
|
|
|
|
|
+import Color4 from './Color4.js';
|
|
|
|
+import { Mesh, SphereGeometry, BackSide } from 'three';
|
|
import { context, normalWorld, backgroundBlurriness, backgroundIntensity, NodeMaterial, modelViewProjection } from '../../nodes/Nodes.js';
|
|
import { context, normalWorld, backgroundBlurriness, backgroundIntensity, NodeMaterial, modelViewProjection } from '../../nodes/Nodes.js';
|
|
|
|
|
|
-let _clearAlpha;
|
|
|
|
-const _clearColor = new Color();
|
|
|
|
|
|
+const _clearColor = new Color4();
|
|
|
|
|
|
class Background extends DataMap {
|
|
class Background extends DataMap {
|
|
|
|
|
|
@@ -31,14 +31,15 @@ class Background extends DataMap {
|
|
// no background settings, use clear color configuration from the renderer
|
|
// no background settings, use clear color configuration from the renderer
|
|
|
|
|
|
_clearColor.copyLinearToSRGB( renderer._clearColor );
|
|
_clearColor.copyLinearToSRGB( renderer._clearColor );
|
|
- _clearAlpha = renderer._clearAlpha;
|
|
|
|
|
|
+ _clearColor.a = renderer._clearColor.a;
|
|
|
|
|
|
} else if ( background.isColor === true ) {
|
|
} else if ( background.isColor === true ) {
|
|
|
|
|
|
// background is an opaque color
|
|
// background is an opaque color
|
|
|
|
|
|
_clearColor.copyLinearToSRGB( background );
|
|
_clearColor.copyLinearToSRGB( background );
|
|
- _clearAlpha = 1;
|
|
|
|
|
|
+ _clearColor.a = 1;
|
|
|
|
+
|
|
forceClear = true;
|
|
forceClear = true;
|
|
|
|
|
|
} else if ( background.isNode === true ) {
|
|
} else if ( background.isNode === true ) {
|
|
@@ -47,7 +48,6 @@ class Background extends DataMap {
|
|
const backgroundNode = background;
|
|
const backgroundNode = background;
|
|
|
|
|
|
_clearColor.copy( renderer._clearColor );
|
|
_clearColor.copy( renderer._clearColor );
|
|
- _clearAlpha = renderer._clearAlpha;
|
|
|
|
|
|
|
|
let backgroundMesh = this.backgroundMesh;
|
|
let backgroundMesh = this.backgroundMesh;
|
|
|
|
|
|
@@ -105,14 +105,14 @@ class Background extends DataMap {
|
|
|
|
|
|
if ( renderer.autoClear === true || forceClear === true ) {
|
|
if ( renderer.autoClear === true || forceClear === true ) {
|
|
|
|
|
|
- _clearColor.multiplyScalar( _clearAlpha );
|
|
|
|
|
|
+ _clearColor.multiplyScalar( _clearColor.a );
|
|
|
|
|
|
const clearColorValue = renderContext.clearColorValue;
|
|
const clearColorValue = renderContext.clearColorValue;
|
|
|
|
|
|
clearColorValue.r = _clearColor.r;
|
|
clearColorValue.r = _clearColor.r;
|
|
clearColorValue.g = _clearColor.g;
|
|
clearColorValue.g = _clearColor.g;
|
|
clearColorValue.b = _clearColor.b;
|
|
clearColorValue.b = _clearColor.b;
|
|
- clearColorValue.a = _clearAlpha;
|
|
|
|
|
|
+ clearColorValue.a = _clearColor.a;
|
|
|
|
|
|
renderContext.depthClearValue = renderer._clearDepth;
|
|
renderContext.depthClearValue = renderer._clearDepth;
|
|
renderContext.stencilClearValue = renderer._clearStencil;
|
|
renderContext.stencilClearValue = renderer._clearStencil;
|