Jelajahi Sumber

multiply blur by hardware scaling to avoid major visual difference when hardware scaling is modified

Trevor Baron 7 tahun lalu
induk
melakukan
7619a5015c
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      src/PostProcess/babylon.blurPostProcess.ts

+ 1 - 1
src/PostProcess/babylon.blurPostProcess.ts

@@ -68,7 +68,7 @@
 			super(name, "kernelBlur", ["delta", "direction", "cameraMinMaxZ"], ["circleOfConfusionSampler"], options, camera, samplingMode, engine, reusable, null, textureType, "kernelBlur", {varyingCount: 0, depCount: 0}, true);
 			this._staticDefines = defines;
 			this.onApplyObservable.add((effect: Effect) => {
-				effect.setFloat2('delta', (1 / this.width) * this.direction.x, (1 / this.height) * this.direction.y);
+				effect.setFloat2('delta', ((1 / this.width) * this.direction.x)*(1/this.getEngine().getHardwareScalingLevel()), ((1 / this.height) * this.direction.y)*(1/this.getEngine().getHardwareScalingLevel()));
 			});
 
             this.kernel = kernel;