소스 검색

Add the "depth clamp" property

Popov72 5 년 전
부모
커밋
d2afc2ac9f
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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();