babylon.blurPostProcess.ts 708 B

12345678910111213
  1. module BABYLON {
  2. export class BlurPostProcess extends PostProcess {
  3. constructor(name: string, public direction: Vector2, public blurWidth: number, ratio: number, camera: Camera, samplingMode: number = BABYLON.Texture.BILINEAR_SAMPLINGMODE, engine?: Engine, reusable?: boolean) {
  4. super(name, "blur", ["screenSize", "direction", "blurWidth"], null, ratio, camera, samplingMode, engine, reusable);
  5. this.onApply = (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. }