babylon.fxaaPostProcess.ts 700 B

123456789101112131415161718
  1. module BABYLON {
  2. export class FxaaPostProcess extends PostProcess {
  3. public texelWidth: number;
  4. public texelHeight: number;
  5. constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean) {
  6. super(name, "fxaa", ["texelSize"], null, ratio, camera, samplingMode, engine, reusable);
  7. this.onSizeChanged = () => {
  8. this.texelWidth = 1.0 / this.width;
  9. this.texelHeight = 1.0 / this.height;
  10. };
  11. this.onApply = (effect: Effect) => {
  12. effect.setFloat2("texelSize", this.texelWidth, this.texelHeight);
  13. }
  14. }
  15. }
  16. }