UNPKG

@tolokoban/tgd

Version:

ToloGameDev library for WebGL2

104 lines 2.83 kB
import { TgdContext } from "../../context"; import { TgdCodeBloc } from "../../shader"; import { TgdTexture2D } from "../../texture"; import { TgdPainter } from "../painter"; export interface TgdPainterPointsCloudOptions { name?: string; /** * Flatten array of points: * `[ x1, y1, z1, radius1, x2, y2, z2, radius2, ... ]` */ dataPoint: Float32Array; /** * Flatten array of UVs: * `[ u1, v1, u2, v2, ... ]` */ dataUV?: Float32Array; /** * Multiply the radius of each point by this value. * * Default to 1. */ radiusMultiplier?: number; /** * Depending on the radius and the distance to the camera, * the point can be invisible. * This value is the minimum size of the point in pixels. * * Default to 0. */ minSizeInPixels?: number; texture?: TgdTexture2D; /** * The content of a fragment shader function that takes * `vec4 color` as argument and must return a `vec4` color. * * The following uniforms are available: * * ```glsl * uniform float uniSpecularExponent; * uniform float uniSpecularIntensity; * uniform float uniShadowThickness; * uniform float uniShadowIntensity; * uniform float uniLight; * ``` * * You can also use `TgdPainterPointsCloud.fragCode*()` static functions * to provide preset functions. */ fragCode?: TgdCodeBloc; /** * Default to 10 */ specularExponent?: number; /** * Default to 0.33 */ specularIntensity?: number; /** * Default to 0.5 */ shadowIntensity?: number; /** * Default to 1 */ shadowThickness?: number; /** * Default to 1 */ light?: number; } export declare class TgdPainterPointsCloud extends TgdPainter { readonly context: TgdContext; /** * Draw spheres with simple diffuse/specular material. */ static fragCodeSphere(options?: Partial<{ specularExponent: number; specularIntensity: number; shadowThickness: number; shadowIntensity: number; light: number; }>): TgdCodeBloc; readonly count: number; texture: TgdTexture2D; radiusMultiplier: number; minSizeInPixels: number; specularExponent: number; specularIntensity: number; shadowIntensity: number; shadowThickness: number; light: number; private readonly dataPoint; private readonly dataUV; private readonly textureMustBeDeleted; private readonly dataset; private readonly program; private readonly vao; constructor(context: TgdContext, options: TgdPainterPointsCloudOptions); delete(): void; paint(): void; private createDataset; private createProgram; } //# sourceMappingURL=points-cloud.d.ts.map