babylon.fxaaPostProcess.js 623 B

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