playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
35 lines (34 loc) • 890 B
JavaScript
class RenderAction {
// {CameraComponent|null}
camera = null;
constructor() {
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;
}
// releases GPU resources
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
};