UNPKG

playcanvas

Version:

PlayCanvas WebGL game engine

55 lines (54 loc) 2.23 kB
/** @ignore */ export class GSplatResource extends GSplatResourceBase { /** * @param {GraphicsDevice} device - The graphics device. * @param {GSplatData} gsplatData - The splat data. */ constructor(device: GraphicsDevice, gsplatData: GSplatData); /** @type {Texture} */ colorTexture: Texture; /** @type {Texture} */ transformATexture: Texture; /** @type {Texture} */ transformBTexture: Texture; /** @type {0 | 1 | 2 | 3} */ shBands: 0 | 1 | 2 | 3; /** @type {Texture | undefined} */ sh1to3Texture: Texture | undefined; /** @type {Texture | undefined} */ sh4to7Texture: Texture | undefined; /** @type {Texture | undefined} */ sh8to11Texture: Texture | undefined; /** @type {Texture | undefined} */ sh12to15Texture: Texture | undefined; /** * Evaluates the texture size needed to store a given number of elements. * The function calculates a width and height that is close to a square * that can contain 'count' elements. * * @param {number} count - The number of elements to store in the texture. * @returns {Vec2} An instance of Vec2 representing the width and height of the texture. */ evalTextureSize(count: number): Vec2; /** * Updates pixel data of this.colorTexture based on the supplied color components and opacity. * Assumes that the texture is using an RGBA format where RGB are color components influenced * by SH spherical harmonics and A is opacity after a sigmoid transformation. * * @param {GSplatData} gsplatData - The source data */ updateColorData(gsplatData: GSplatData): void; /** * @param {GSplatData} gsplatData - The source data */ updateTransformData(gsplatData: GSplatData): void; /** * @param {GSplatData} gsplatData - The source data */ updateSHData(gsplatData: GSplatData): void; } import { GSplatResourceBase } from './gsplat-resource-base.js'; import type { Texture } from '../../platform/graphics/texture.js'; import { Vec2 } from '../../core/math/vec2.js'; import type { GSplatData } from './gsplat-data.js'; import type { GraphicsDevice } from '../../platform/graphics/graphics-device.js';