UNPKG

playcanvas

Version:

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

54 lines (53 loc) 2.44 kB
/** * A render pass implementing rendering of mesh instances into a pick buffer. * * @ignore */ export class RenderPassPicker extends RenderPass { constructor(device: any, renderer: any); /** @type {BlendState} */ blendState: BlendState; /** @type {CameraComponent} */ camera: CameraComponent; /** @type {Scene} */ scene: Scene; /** @type {Layer[]} */ layers: Layer[]; /** @type {Map<number, MeshInstance | GSplatComponent>} */ mapping: Map<number, MeshInstance | GSplatComponent>; /** @type {boolean} */ depth: boolean; /** @type {number[]} */ _qualifiedLayerIndices: number[]; /** @type {Map<number, MeshInstance|null>} */ _pickMeshInstances: Map<number, MeshInstance | null>; /** * Minimal view uniform format used by the picker. The pick shaders only need the view * projection (and the view matrix for depth picking); any other view uniform a shader happens * to reference falls back to the per-mesh uniform buffer automatically. This avoids pulling in * the full forward view format (and its lighting / shadow uniforms) which the picker does not * need. * * @type {UniformBufferFormat|null} */ _viewUniformFormat: UniformBufferFormat | null; renderer: any; getViewUniformFormat(): UniformBufferFormat; /** * @param {CameraComponent} camera - The camera component used for picking. * @param {Scene} scene - The scene to pick from. * @param {Layer[]} layers - The layers to pick from. * @param {Map<number, MeshInstance | GSplatComponent>} mapping - Map to store ID to object mappings. * @param {boolean} depth - Whether to render depth information. */ update(camera: CameraComponent, scene: Scene, layers: Layer[], mapping: Map<number, MeshInstance | GSplatComponent>, depth: boolean): void; emptyWorldClusters: any; } import { RenderPass } from '../../platform/graphics/render-pass.js'; import { BlendState } from '../../platform/graphics/blend-state.js'; import type { CameraComponent } from '../components/camera/component.js'; import type { Scene } from '../../scene/scene.js'; import type { Layer } from '../../scene/layer.js'; import type { MeshInstance } from '../../scene/mesh-instance.js'; import type { GSplatComponent } from '../components/gsplat/component.js'; import { UniformBufferFormat } from '../../platform/graphics/uniform-buffer-format.js';