UNPKG

playcanvas

Version:

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

52 lines (51 loc) 1.7 kB
/** * A class managing instances of world clusters used by the renderer for layers with * unique sets of clustered lights. * * @ignore */ export class WorldClustersAllocator { /** * Create a new instance. * * @param {GraphicsDevice} graphicsDevice - The graphics device. */ constructor(graphicsDevice: GraphicsDevice); /** * Empty cluster with no lights. * * @type {WorldClusters|null} */ _empty: WorldClusters | null; /** * All allocated clusters * * @type {WorldClusters[]} */ _allocated: WorldClusters[]; /** * Render actions with all unique light clusters. The key is the hash of lights on a layer, the * value is a render action with unique light clusters. * * @type {Map<number, RenderAction>} */ _clusters: Map<number, RenderAction>; device: GraphicsDevice; destroy(): void; get count(): number; get empty(): WorldClusters; /** * Assign clusters for one frame pass that owns {@link RenderPass#renderActions}. * No-op when the pass has no render actions. * * @param {import('../../platform/graphics/frame-pass.js').FramePass} renderPass - Render pass * (not a {@link FramePassMultiView} wrapper; those are unwrapped in {@link WorldClustersAllocator#assign}). * @private */ private _assignClustersForPass; assign(renderPasses: any): void; update(renderPasses: any, lighting: any): void; } import { WorldClusters } from '../lighting/world-clusters.js'; import type { RenderAction } from '../composition/render-action.js'; import type { GraphicsDevice } from '../../platform/graphics/graphics-device.js';