babylon.postProcessRenderPass.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. var BABYLON;
  2. (function (BABYLON) {
  3. var PostProcessRenderPass = (function () {
  4. function PostProcessRenderPass(scene, name, size, renderList, beforeRender, afterRender) {
  5. this.name = name;
  6. this._enabled = true;
  7. this._refCount = 0;
  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. }
  14. PostProcessRenderPass.prototype.incRefCount = function () {
  15. if (this._refCount == 0) {
  16. this._scene.customRenderTargets.push(this._renderTexture);
  17. }
  18. return ++this._refCount;
  19. };
  20. PostProcessRenderPass.prototype.decRefCount = function () {
  21. this._refCount--;
  22. if (this._refCount <= 0) {
  23. this._scene.customRenderTargets.splice(this._scene.customRenderTargets.indexOf(this._renderTexture), 1);
  24. }
  25. return this._refCount;
  26. };
  27. PostProcessRenderPass.prototype.setRenderList = function (renderList) {
  28. this._renderTexture.renderList = renderList;
  29. };
  30. PostProcessRenderPass.prototype.getRenderTexture = function () {
  31. return this._renderTexture;
  32. };
  33. PostProcessRenderPass.prototype._update = function () {
  34. this.setRenderList(this._renderList);
  35. };
  36. return PostProcessRenderPass;
  37. })();
  38. BABYLON.PostProcessRenderPass = PostProcessRenderPass;
  39. })(BABYLON || (BABYLON = {}));
  40. //# sourceMappingURL=babylon.postProcessRenderPass.js.map