Selaa lähdekoodia

Add the "depth clamp" property

Popov72 5 vuotta sitten
vanhempi
commit
d2afc2ac9f
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      src/Lights/Shadows/cascadedShadowGenerator.ts

+ 6 - 0
src/Lights/Shadows/cascadedShadowGenerator.ts

@@ -470,6 +470,8 @@ export class CascadedShadowGenerator implements IShadowGenerator {
         this._light._markMeshesAsLightDirty();
     }
 
+    public depthClamp: boolean = false;
+
     private _lambda = 0.5;
 
     /**
@@ -998,6 +1000,10 @@ export class CascadedShadowGenerator implements IShadowGenerator {
 
         defines.push("#define DEPTHTEXTURE");
 
+        if (this.depthClamp) {
+            defines.push("#define DEPTHCLAMP");
+        }
+
         var attribs = [VertexBuffer.PositionKind];
 
         var mesh = subMesh.getMesh();