babylon.blurPostProcess.js 1.2 KB

12345678910111213141516171819202122232425
  1. var __extends = (this && this.__extends) || function (d, b) {
  2. for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
  3. function __() { this.constructor = d; }
  4. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  5. };
  6. var BABYLON;
  7. (function (BABYLON) {
  8. var BlurPostProcess = (function (_super) {
  9. __extends(BlurPostProcess, _super);
  10. function BlurPostProcess(name, direction, blurWidth, ratio, camera, samplingMode, engine, reusable) {
  11. var _this = this;
  12. if (samplingMode === void 0) { samplingMode = BABYLON.Texture.BILINEAR_SAMPLINGMODE; }
  13. _super.call(this, name, "blur", ["screenSize", "direction", "blurWidth"], null, ratio, camera, samplingMode, engine, reusable);
  14. this.direction = direction;
  15. this.blurWidth = blurWidth;
  16. this.onApply = function (effect) {
  17. effect.setFloat2("screenSize", _this.width, _this.height);
  18. effect.setVector2("direction", _this.direction);
  19. effect.setFloat("blurWidth", _this.blurWidth);
  20. };
  21. }
  22. return BlurPostProcess;
  23. })(BABYLON.PostProcess);
  24. BABYLON.BlurPostProcess = BlurPostProcess;
  25. })(BABYLON || (BABYLON = {}));