babylon.blurPostProcess.js 849 B

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