12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- "use strict";
- var BABYLON = BABYLON || {};
- (function () {
- BABYLON.RenderPass = function RenderPass(scene, name, size, renderList, beforeRender, afterRender) {
- this._name = name;
- this._enabled = true;
- this._renderList = renderList;
- this._renderTexture = new BABYLON.RenderTargetTexture(name, size, scene);
- this.setRenderList(renderList);
- this._renderTexture.onBeforeRender = beforeRender;
- this._renderTexture.onAfterRender = afterRender;
- this._refCount = 0;
- };
- BABYLON.RenderPass.prototype.incRefCount = function () {
- if (this._refCount == 0) {
- scene.customRenderTargets.push(this._renderTexture);
- }
- this._refCount++;
- };
- BABYLON.RenderPass.prototype.decRefCount = function () {
- this._refCount--;
- if (this._refCount <= 0) {
- scene.customRenderTargets.splice(scene.customRenderTargets.indexOf(this._renderTexture), 1);
- }
- };
- BABYLON.RenderPass.prototype.setRenderList = function (renderList) {
- this._renderTexture.renderList = renderList;
- };
- BABYLON.RenderPass.prototype.getRenderTexture = function () {
- return this._renderTexture;
- };
- BABYLON.RenderPass.prototype._update = function () {
- this.setRenderList(this._renderList);
- };
- })();
|