babylon.fxaaPostProcess.ts 762 B

123456789101112131415
  1. module BABYLON {
  2. export class FxaaPostProcess extends PostProcess {
  3. public texelWidth: number;
  4. public texelHeight: number;
  5. constructor(name: string, options: number | PostProcessOptions, camera: Nullable<Camera> = null, samplingMode?: number, engine?: Engine, reusable?: boolean, textureType: number = Engine.TEXTURETYPE_UNSIGNED_INT) {
  6. super(name, "fxaa", ["texelSize"], null, options, camera, samplingMode || Texture.BILINEAR_SAMPLINGMODE, engine, reusable, null, textureType, "fxaa");
  7. this.onApplyObservable.add((effect: Effect) => {
  8. var texelSize = this.texelSize;
  9. effect.setFloat2("texelSize", texelSize.x, texelSize.y);
  10. });
  11. }
  12. }
  13. }