소스 검색

Check if post-process exists before update the effect when setting up advanced parameters in StandardRenderingPipeline

Julien Moreau-Mathis 8 년 전
부모
커밋
8c2b8eabef
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      src/PostProcess/RenderPipeline/Pipelines/babylon.standardRenderingPipeline.ts

+ 8 - 2
src/PostProcess/RenderPipeline/Pipelines/babylon.standardRenderingPipeline.ts

@@ -210,7 +210,10 @@
         }
 
         public set volumetricLightStepsCount(count: number) {
-            this.volumetricLightPostProcess.updateEffect("#define VLS\n#define NB_STEPS " + count.toFixed(1));
+            if (this.volumetricLightPostProcess) {
+                this.volumetricLightPostProcess.updateEffect("#define VLS\n#define NB_STEPS " + count.toFixed(1));
+            }
+
             this._volumetricLightStepsCount = count;
         }
 
@@ -220,7 +223,10 @@
         }
 
         public set motionBlurSamples(samples: number) {
-            this.motionBlurPostProcess.updateEffect("#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES " + samples.toFixed(1));
+            if (this.motionBlurPostProcess) {
+                this.motionBlurPostProcess.updateEffect("#define MOTION_BLUR\n#define MAX_MOTION_SAMPLES " + samples.toFixed(1));
+            }
+            
             this._motionBlurSamples = samples;
         }