Преглед на файлове

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;
         }