babylon.postProcessRenderPass.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. }
  14. // private
  15. PostProcessRenderPass.prototype._incRefCount = function () {
  16. if (this._refCount === 0) {
  17. this._scene.customRenderTargets.push(this._renderTexture);
  18. }
  19. return ++this._refCount;
  20. };
  21. PostProcessRenderPass.prototype._decRefCount = function () {
  22. this._refCount--;
  23. if (this._refCount <= 0) {
  24. this._scene.customRenderTargets.splice(this._scene.customRenderTargets.indexOf(this._renderTexture), 1);
  25. }
  26. return this._refCount;
  27. };
  28. PostProcessRenderPass.prototype._update = function () {
  29. this.setRenderList(this._renderList);
  30. };
  31. // public
  32. PostProcessRenderPass.prototype.setRenderList = function (renderList) {
  33. this._renderTexture.renderList = renderList;
  34. };
  35. PostProcessRenderPass.prototype.getRenderTexture = function () {
  36. return this._renderTexture;
  37. };
  38. return PostProcessRenderPass;
  39. })();
  40. BABYLON.PostProcessRenderPass = PostProcessRenderPass;
  41. })(BABYLON || (BABYLON = {}));
  42. //# sourceMappingURL=babylon.postProcessRenderPass.js.map