babylon.blurPostProcess.js 864 B

1234567891011121314151617181920212223242526
  1. "use strict";
  2. var BABYLON = BABYLON || {};
  3. (function () {
  4. BABYLON.BlurPostProcess = function (name, direction, blurWidth, ratio, camera, samplingMode) {
  5. if (samplingMode === undefined) {
  6. samplingMode = BABYLON.Texture.BILINEAR_SAMPLINGMODE;
  7. }
  8. BABYLON.PostProcess.call(this, name, "blur", ["screenSize", "direction", "blurWidth"], null, ratio, camera, samplingMode);
  9. this.direction = direction;
  10. this.blurWidth = blurWidth;
  11. var that = this;
  12. this.onApply = function (effect) {
  13. effect.setFloat2("screenSize", that.width, that.height);
  14. effect.setVector2("direction", that.direction);
  15. effect.setFloat("blurWidth", that.blurWidth);
  16. };
  17. };
  18. BABYLON.BlurPostProcess.prototype = Object.create(BABYLON.PostProcess.prototype);
  19. })();