فهرست منبع

fixes scene background issue

when setting a texture, or a black color as scene.background, outline was weird, or invisible.
Atrahasis 7 سال پیش
والد
کامیت
ae1465744c
1فایلهای تغییر یافته به همراه5 افزوده شده و 0 حذف شده
  1. 5 0
      examples/js/postprocessing/OutlinePass.js

+ 5 - 0
examples/js/postprocessing/OutlinePass.js

@@ -249,6 +249,9 @@ THREE.OutlinePass.prototype = Object.assign( Object.create( THREE.Pass.prototype
 		// Make selected objects invisible
 		this.changeVisibilityOfSelectedObjects( false );
 
+		var bg = this.renderScene.background;
+		this.renderScene.background = null;
+
 		// 1. Draw Non Selected objects in the depth buffer
 		this.renderScene.overrideMaterial = this.depthMaterial;
 		renderer.render( this.renderScene, this.renderCamera, this.renderTargetDepthBuffer, true );
@@ -269,6 +272,8 @@ THREE.OutlinePass.prototype = Object.assign( Object.create( THREE.Pass.prototype
 		this.renderScene.overrideMaterial = null;
 		this.changeVisibilityOfNonSelectedObjects( true );
 
+		this.renderScene.background = bg;
+
 		// 2. Downsample to Half resolution
 		this.quad.material = this.materialCopy;
 		this.copyUniforms[ "tDiffuse" ].value = this.renderTargetMaskBuffer.texture;