Преглед изворни кода

Merge pull request #5017 from TrevorDev/utilityLayerDepthWithPostProcess

still clear depth/stencil in post process when _allowPostProcessClear…
David Catuhe пре 7 година
родитељ
комит
7f10005f83

+ 2 - 2
src/PostProcess/babylon.postProcess.ts

@@ -489,8 +489,8 @@
             this.onActivateObservable.notifyObservers(camera);
             this.onActivateObservable.notifyObservers(camera);
 
 
             // Clear
             // Clear
-            if (scene._allowPostProcessClear && this.autoClear && this.alphaMode === Engine.ALPHA_DISABLE) {
-                this._engine.clear(this.clearColor ? this.clearColor : scene.clearColor, true, true, true);
+            if (this.autoClear && this.alphaMode === Engine.ALPHA_DISABLE) {
+                this._engine.clear(this.clearColor ? this.clearColor : scene.clearColor, scene._allowPostProcessClearColor, true, true);
             }
             }
 
 
             if (this._reusable) {
             if (this._reusable) {

+ 1 - 1
src/Rendering/babylon.utilityLayerRenderer.ts

@@ -72,7 +72,7 @@ module BABYLON {
             public originalScene: Scene){
             public originalScene: Scene){
             // Create scene which will be rendered in the foreground and remove it from being referenced by engine to avoid interfering with existing app
             // Create scene which will be rendered in the foreground and remove it from being referenced by engine to avoid interfering with existing app
             this.utilityLayerScene = new BABYLON.Scene(originalScene.getEngine());
             this.utilityLayerScene = new BABYLON.Scene(originalScene.getEngine());
-            this.utilityLayerScene._allowPostProcessClear = false;
+            this.utilityLayerScene._allowPostProcessClearColor = false;
             originalScene.getEngine().scenes.pop();
             originalScene.getEngine().scenes.pop();
       
       
             // Detach controls on utility scene, events will be fired by logic below to handle picking priority
             // Detach controls on utility scene, events will be fired by logic below to handle picking priority

+ 1 - 1
src/babylon.scene.ts

@@ -4298,7 +4298,7 @@
             this._setAlternateTransformMatrix(alternateCamera.getViewMatrix(), alternateCamera.getProjectionMatrix());
             this._setAlternateTransformMatrix(alternateCamera.getViewMatrix(), alternateCamera.getProjectionMatrix());
         }
         }
         /** @hidden */
         /** @hidden */
-        public _allowPostProcessClear = true;
+        public _allowPostProcessClearColor = true;
         private _renderForCamera(camera: Camera, rigParent?: Camera): void {
         private _renderForCamera(camera: Camera, rigParent?: Camera): void {
             if (camera && camera._skipRendering) {
             if (camera && camera._skipRendering) {
                 return;
                 return;