babylon.fxaaPostProcess.js 678 B

123456789101112131415161718
  1. "use strict";
  2. var BABYLON = BABYLON || {};
  3. (function () {
  4. BABYLON.FxaaPostProcess = function (name, ratio, camera, samplingMode) {
  5. BABYLON.PostProcess.call(this, name, "fxaa", ["texelSize"], null, ratio, camera, samplingMode);
  6. };
  7. BABYLON.FxaaPostProcess.prototype = Object.create(BABYLON.PostProcess.prototype);
  8. BABYLON.FxaaPostProcess.prototype.onSizeChanged = function () {
  9. this.texelWidth = 1.0 / this.width;
  10. this.texelHeight = 1.0 / this.height;
  11. };
  12. BABYLON.FxaaPostProcess.prototype.onApply = function (effect) {
  13. effect.setFloat2("texelSize", this.texelWidth, this.texelHeight);
  14. };
  15. })();