babylon.postProcessRenderPass.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. var BABYLON;
  2. (function (BABYLON) {
  3. var PostProcessRenderPass = (function () {
  4. function PostProcessRenderPass(scene, name, size, renderList, beforeRender, afterRender) {
  5. this._enabled = true;
  6. this._refCount = 0;
  7. this._name = name;
  8. this._renderTexture = new BABYLON.RenderTargetTexture(name, size, scene);
  9. this.setRenderList(renderList);
  10. this._renderTexture.onBeforeRender = beforeRender;
  11. this._renderTexture.onAfterRender = afterRender;
  12. this._scene = scene;
  13. this._renderList = renderList;
  14. }
  15. // private
  16. PostProcessRenderPass.prototype._incRefCount = function () {
  17. if (this._refCount === 0) {
  18. this._scene.customRenderTargets.push(this._renderTexture);
  19. }
  20. return ++this._refCount;
  21. };
  22. PostProcessRenderPass.prototype._decRefCount = function () {
  23. this._refCount--;
  24. if (this._refCount <= 0) {
  25. this._scene.customRenderTargets.splice(this._scene.customRenderTargets.indexOf(this._renderTexture), 1);
  26. }
  27. return this._refCount;
  28. };
  29. PostProcessRenderPass.prototype._update = function () {
  30. this.setRenderList(this._renderList);
  31. };
  32. // public
  33. PostProcessRenderPass.prototype.setRenderList = function (renderList) {
  34. this._renderTexture.renderList = renderList;
  35. };
  36. PostProcessRenderPass.prototype.getRenderTexture = function () {
  37. return this._renderTexture;
  38. };
  39. return PostProcessRenderPass;
  40. })();
  41. BABYLON.PostProcessRenderPass = PostProcessRenderPass;
  42. })(BABYLON || (BABYLON = {}));
  43. //# sourceMappingURL=babylon.postProcessRenderPass.js.map