|
@@ -32,9 +32,16 @@ RenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
|
var oldAutoClear = renderer.autoClear;
|
|
|
renderer.autoClear = false;
|
|
|
|
|
|
- this.scene.overrideMaterial = this.overrideMaterial;
|
|
|
|
|
|
- var oldClearColor, oldClearAlpha;
|
|
|
+ var oldClearColor, oldClearAlpha, oldOverrideMaterial;
|
|
|
+
|
|
|
+ if ( this.overrideMaterial !== undefined ) {
|
|
|
+
|
|
|
+ oldOverrideMaterial = this.scene.overrideMaterial;
|
|
|
+
|
|
|
+ this.scene.overrideMaterial = this.overrideMaterial;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
if ( this.clearColor ) {
|
|
|
|
|
@@ -63,7 +70,12 @@ RenderPass.prototype = Object.assign( Object.create( Pass.prototype ), {
|
|
|
|
|
|
}
|
|
|
|
|
|
- this.scene.overrideMaterial = null;
|
|
|
+ if ( this.overrideMaterial !== undefined ) {
|
|
|
+
|
|
|
+ this.scene.overrideMaterial = oldOverrideMaterial;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
renderer.autoClear = oldAutoClear;
|
|
|
|
|
|
}
|