UNPKG

playcanvas

Version:

PlayCanvas WebGL game engine

32 lines (30 loc) 889 B
class RenderAction { constructor(){ this.camera = null; this.layer = null; this.transparent = false; this.renderTarget = null; this.lightClusters = null; this.clearColor = false; this.clearDepth = false; this.clearStencil = false; this.triggerPostprocess = false; this.firstCameraUse = false; this.lastCameraUse = false; this.viewBindGroups = []; this.useCameraPasses = false; } destroy() { this.viewBindGroups.forEach((bg)=>{ bg.defaultUniformBuffer.destroy(); bg.destroy(); }); this.viewBindGroups.length = 0; } setupClears(camera, layer) { this.clearColor = camera?.clearColorBuffer || layer.clearColorBuffer; this.clearDepth = camera?.clearDepthBuffer || layer.clearDepthBuffer; this.clearStencil = camera?.clearStencilBuffer || layer.clearStencilBuffer; } } export { RenderAction };