|
@@ -1,3 +1,6 @@
|
|
|
+import {
|
|
|
+ Color
|
|
|
+} from "../../../build/three.module.js";
|
|
|
import { Pass } from "../postprocessing/Pass.js";
|
|
|
|
|
|
var RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
|
|
@@ -15,6 +18,7 @@ var RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAl
|
|
|
this.clear = true;
|
|
|
this.clearDepth = false;
|
|
|
this.needsSwap = false;
|
|
|
+ this.oldClearColor = new Color();
|
|
|
|
|
|
};
|
|
|
|
|
@@ -27,7 +31,7 @@ RenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
|
var oldAutoClear = renderer.autoClear;
|
|
|
renderer.autoClear = false;
|
|
|
|
|
|
- var oldClearColor, oldClearAlpha, oldOverrideMaterial;
|
|
|
+ var oldClearAlpha, oldOverrideMaterial;
|
|
|
|
|
|
if ( this.overrideMaterial !== undefined ) {
|
|
|
|
|
@@ -39,7 +43,7 @@ RenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
|
|
|
|
if ( this.clearColor ) {
|
|
|
|
|
|
- oldClearColor = renderer.getClearColor().getHex();
|
|
|
+ renderer.getClearColor( this.oldClearColor );
|
|
|
oldClearAlpha = renderer.getClearAlpha();
|
|
|
|
|
|
renderer.setClearColor( this.clearColor, this.clearAlpha );
|
|
@@ -60,7 +64,7 @@ RenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
|
|
|
|
if ( this.clearColor ) {
|
|
|
|
|
|
- renderer.setClearColor( oldClearColor, oldClearAlpha );
|
|
|
+ renderer.setClearColor( this.oldClearColor, oldClearAlpha );
|
|
|
|
|
|
}
|
|
|
|