UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

54 lines (52 loc) 1.01 kB
class FramePass { set name(value) { this._name = value; } get name() { if (!this._name) { this._name = this.constructor.name; } return this._name; } set enabled(value) { if (this._enabled !== value) { this._enabled = value; if (value) { this.onEnable(); } else { this.onDisable(); } } } get enabled() { return this._enabled; } onEnable() {} onDisable() {} frameUpdate() {} before() {} execute() {} after() {} destroy() {} render() { if (this.enabled) { this.before(); if (this.executeEnabled) { this.execute(); } this.after(); this.device.renderPassIndex++; } } constructor(graphicsDevice){ this._enabled = true; this._skipStart = false; this._skipEnd = false; this.executeEnabled = true; this.requiresCubemaps = false; this.beforePasses = []; this.afterPasses = []; this.device = graphicsDevice; } } export { FramePass };