瀏覽代碼

Remove unneeded code

Popov72 5 年之前
父節點
當前提交
af205ff119
共有 2 個文件被更改,包括 6 次插入18 次删除
  1. 3 9
      src/Lights/Shadows/cascadedShadowGenerator.ts
  2. 3 9
      src/Lights/Shadows/shadowGenerator.ts

+ 3 - 9
src/Lights/Shadows/cascadedShadowGenerator.ts

@@ -816,17 +816,11 @@ export class CascadedShadowGenerator extends ShadowGenerator {
     }
 
     protected _bindCustomEffectForRenderSubMeshForShadowMap(subMesh: SubMesh, effect: Effect): void {
-        if (effect.getUniform("viewProjection")) {
-            effect.setMatrix("viewProjection", this.getCascadeTransformMatrix(this._currentLayer)!);
-        }
+        effect.setMatrix("viewProjection", this.getCascadeTransformMatrix(this._currentLayer)!);
 
-        if (effect.getUniform("view")) {
-            effect.setMatrix("view", this.getCascadeViewMatrix(this._currentLayer)!);
-        }
+        effect.setMatrix("view", this.getCascadeViewMatrix(this._currentLayer)!);
 
-        if (effect.getUniform("projection")) {
-            effect.setMatrix("projection", this.getCascadeProjectionMatrix(this._currentLayer)!);
-        }
+        effect.setMatrix("projection", this.getCascadeProjectionMatrix(this._currentLayer)!);
     }
 
     protected _isReadyCustomDefines(defines: any, subMesh: SubMesh, useInstances: boolean): void {

+ 3 - 9
src/Lights/Shadows/shadowGenerator.ts

@@ -1018,17 +1018,11 @@ export class ShadowGenerator implements IShadowGenerator {
     }
 
     protected _bindCustomEffectForRenderSubMeshForShadowMap(subMesh: SubMesh, effect: Effect): void {
-        if (effect.getUniform("viewProjection")) {
-            effect.setMatrix("viewProjection", this.getTransformMatrix());
-        }
+        effect.setMatrix("viewProjection", this.getTransformMatrix());
 
-        if (effect.getUniform("view")) {
-            effect.setMatrix("view", this._viewMatrix);
-        }
+        effect.setMatrix("view", this._viewMatrix);
 
-        if (effect.getUniform("projection")) {
-            effect.setMatrix("projection", this._projectionMatrix);
-        }
+        effect.setMatrix("projection", this._projectionMatrix);
     }
 
     protected _renderSubMeshForShadowMap(subMesh: SubMesh): void {