babylon.blurPostProcess.js 693 B

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