playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
38 lines (37 loc) • 1.28 kB
JavaScript
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
class RenderAction {
constructor() {
// {CameraComponent|null}
__publicField(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;
}
// 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
};