babylon.blurPostProcess.ts 750 B

12345678910111213
  1. module BABYLON {
  2. export class BlurPostProcess extends PostProcess {
  3. constructor(name: string, public direction: Vector2, public blurWidth: number, options: number | PostProcessOptions, camera: Camera, samplingMode: number = Texture.BILINEAR_SAMPLINGMODE, engine?: Engine, reusable?: boolean) {
  4. super(name, "blur", ["screenSize", "direction", "blurWidth"], null, options, camera, samplingMode, engine, reusable);
  5. this.onApplyObservable.add((effect: Effect) => {
  6. effect.setFloat2("screenSize", this.width, this.height);
  7. effect.setVector2("direction", this.direction);
  8. effect.setFloat("blurWidth", this.blurWidth);
  9. });
  10. }
  11. }
  12. }