Browse Source

Add the "depth clamp" property

Popov72 5 năm trước cách đây
mục cha
commit
d2afc2ac9f
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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();