Ver código fonte

Change default value in DepthRenderer to 1.0

Currently the DepthRenderer buffer is cleared with the scene clear color, which is very practical when using the depth values in shader.
jahow 10 anos atrás
pai
commit
c4750dd012
1 arquivos alterados com 6 adições e 1 exclusões
  1. 6 1
      Babylon/Rendering/babylon.depthRenderer.ts

+ 6 - 1
Babylon/Rendering/babylon.depthRenderer.ts

@@ -22,6 +22,11 @@
             this._depthMap.refreshRate = 1;
             this._depthMap.renderParticles = false;
             this._depthMap.renderList = null;
+            
+            // set default depth value to 1.0 (far away)
+            this._depthMap.onClear = (engine: Engine) => {
+                engine.clear(new Color4(1.0, 1.0, 1.0, 1.0), true, true);
+            }
 
             // Custom render function
             var renderSubMesh = (subMesh: SubMesh): void => {
@@ -142,4 +147,4 @@
             this._depthMap.dispose();
         }
     }
-} 
+}