UNPKG

playcanvas

Version:

PlayCanvas WebGL game engine

60 lines (59 loc) 2.2 kB
/** @ignore */ export class GSplatInstance { /** * @param {GSplatResourceBase} resource - The splat instance. * @param {ShaderMaterial|null} material - The material instance. */ constructor(resource: GSplatResourceBase, material: ShaderMaterial | null); /** @type {GSplatResourceBase} */ resource: GSplatResourceBase; /** @type {Texture} */ orderTexture: Texture; /** @type {ShaderMaterial} */ _material: ShaderMaterial; /** @type {MeshInstance} */ meshInstance: MeshInstance; options: {}; /** @type {GSplatSorter | null} */ sorter: GSplatSorter | null; lastCameraPosition: Vec3; lastCameraDirection: Vec3; /** * List of cameras this instance is visible for. Updated every frame by the renderer. * * @type {Camera[]} * @ignore */ cameras: Camera[]; destroy(): void; /** * @param {ShaderMaterial} value - The material instance. */ set material(value: ShaderMaterial); get material(): ShaderMaterial; /** * Configure the material with gsplat instance and resource properties. * * @param {ShaderMaterial} material - The material to configure. * @param {object} [options] - Object for passing optional arguments. * @param {boolean} [options.dither] - Specify true to configure the material for dithered rendering (stochastic alpha). */ configureMaterial(material: ShaderMaterial, options?: { dither?: boolean; }): void; updateViewport(cameraNode: any): void; /** * Sorts the GS vertices based on the given camera. * @param {GraphNode} cameraNode - The camera node used for sorting. */ sort(cameraNode: GraphNode): void; update(): void; } import type { GSplatResourceBase } from './gsplat-resource-base.js'; import type { Texture } from '../../platform/graphics/texture.js'; import { ShaderMaterial } from '../materials/shader-material.js'; import { MeshInstance } from '../mesh-instance.js'; import { GSplatSorter } from './gsplat-sorter.js'; import { Vec3 } from '../../core/math/vec3.js'; import type { Camera } from '../camera.js'; import type { GraphNode } from '../graph-node.js';