import { BufferGeometry, Camera, Color, Material, RawShaderMaterial, Scene, Texture, Vector3, Vector4, WebGLRenderer } from 'three'; import { PointCloudOctree } from '../point-cloud-octree'; import { PointCloudOctreeNode } from '../point-cloud-octree-node'; import { ClipMode, IClipBox, IClipSphere } from './clipping'; import { PointColorType, PointOpacityType, PointShape, PointSizeType, TreeType } from './enums'; import { IClassification, IGradient, IUniform } from './types'; import { ColorEncoding } from './color-encoding'; /** * Configuration parameters for point cloud material rendering. * * @interface IPointCloudMaterialParameters */ export interface IPointCloudMaterialParameters { /** * The base size of points in the point cloud. */ size: number; /** * The minimum allowed size for points when scaling. */ minSize: number; /** * The maximum allowed size for points when scaling. */ maxSize: number; /** * The type of tree structure used for organizing the point cloud data. */ treeType: TreeType; /** * Whether to use the new format for point cloud data processing. */ newFormat: boolean; } /** * Interface defining uniforms for point cloud material rendering in WebGL shaders. * These uniforms control various aspects of point cloud visualization including * appearance, filtering, transformations, and rendering parameters. * * @interface IPointCloudMaterialUniforms */ export interface IPointCloudMaterialUniforms { /** Bounding box size as [width, height, depth] */ bbSize: IUniform<[number, number, number]>; /** Supplement value for depth blending calculations */ blendDepthSupplement: IUniform; /** Hardness factor for blending operations */ blendHardness: IUniform; /** Lookup texture for point classification rendering */ classificationLUT: IUniform; /** Number of active clipping boxes */ clipBoxCount: IUniform; /** Array containing clipping box parameters */ clipBoxes: IUniform; /** Number of active clipping spheres */ clipSphereCount: IUniform; /** Array containing clipping sphere parameters (vec4: xyz=center, w=radius) */ clipSpheres: IUniform; /** Number of active clipping planes */ clipPlaneCount: IUniform; /** Array containing clipping plane parameters (vec4: xyz=normal, w=constant) */ clipPlanes: IUniform; /** Depth map texture for depth-based effects, null if not used */ depthMap: IUniform; /** Diffuse color as RGB values [r, g, b] */ diffuse: IUniform<[number, number, number]>; /** Field of view angle in radians */ fov: IUniform; /** Gradient texture for color mapping */ gradient: IUniform; /** Maximum height value for elevation-based coloring */ heightMax: IUniform; /** Minimum height value for elevation-based coloring */ heightMin: IUniform; /** Brightness adjustment for intensity values */ intensityBrightness: IUniform; /** Contrast adjustment for intensity values */ intensityContrast: IUniform; /** Gamma correction for intensity values */ intensityGamma: IUniform; /** Intensity range as [min, max] values */ intensityRange: IUniform<[number, number]>; /** Current level of detail */ level: IUniform; /** Maximum point size in pixels */ maxSize: IUniform; /** Minimum point size in pixels */ minSize: IUniform; /** Size of the octree structure */ octreeSize: IUniform; /** Overall opacity of the point cloud (0.0 to 1.0) */ opacity: IUniform; /** Point cloud index identifier */ pcIndex: IUniform; /** Brightness adjustment for RGB color values */ rgbBrightness: IUniform; /** Contrast adjustment for RGB color values */ rgbContrast: IUniform; /** Gamma correction for RGB color values */ rgbGamma: IUniform; /** Screen height in pixels */ screenHeight: IUniform; /** Screen width in pixels */ screenWidth: IUniform; /** Orthographic camera height */ orthoHeight: IUniform; /** Orthographic camera width */ orthoWidth: IUniform; /** Flag indicating whether orthographic camera is being used */ useOrthographicCamera: IUniform; /** Far clipping plane distance */ far: IUniform; /** Base point size */ size: IUniform; /** Spacing between points */ spacing: IUniform; /** Transformation matrix to model space */ toModel: IUniform; /** Transition factor for animations or interpolations */ transition: IUniform; /** Color uniform for material */ uColor: IUniform; /** Texture containing visible node information */ visibleNodes: IUniform; /** Starting index for visible nodes */ vnStart: IUniform; /** Weight factor for classification-based coloring */ wClassification: IUniform; /** Weight factor for elevation-based coloring */ wElevation: IUniform; /** Weight factor for intensity-based coloring */ wIntensity: IUniform; /** Weight factor for return number-based coloring */ wReturnNumber: IUniform; /** Weight factor for RGB color contribution */ wRGB: IUniform; /** Weight factor for source ID-based coloring */ wSourceID: IUniform; /** Opacity attenuation factor based on distance or other criteria */ opacityAttenuation: IUniform; /** Threshold value for normal-based point filtering */ filterByNormalThreshold: IUniform; /** 3D coordinate of the highlighted point */ highlightedPointCoordinate: IUniform; /** RGBA color for highlighted point rendering */ highlightedPointColor: IUniform; /** Flag to enable or disable point highlighting feature */ enablePointHighlighting: IUniform; /** Scale factor for highlighted point size */ highlightedPointScale: IUniform; /** Scale factor for view-dependent sizing */ viewScale: IUniform; } export declare class PointCloudMaterial extends RawShaderMaterial { private static helperVec3; lights: boolean; fog: boolean; numClipBoxes: number; clipBoxes: IClipBox[]; numClipSpheres: number; clipSpheres: IClipSphere[]; private numClipPlanes; visibleNodesTexture: Texture | undefined; private visibleNodeTextureOffsets; private _gradient; private gradientTexture; private _classification; private classificationTexture; uniforms: IPointCloudMaterialUniforms & Record>; bbSize: [number, number, number]; depthMap: Texture | undefined; fov: number; heightMax: number; heightMin: number; intensityBrightness: number; intensityContrast: number; intensityGamma: number; intensityRange: [number, number]; maxSize: number; minSize: number; octreeSize: number; opacity: number; rgbBrightness: number; rgbContrast: number; rgbGamma: number; screenHeight: number; screenWidth: number; orthoWidth: number; orthoHeight: number; useOrthographicCamera: boolean; far: number; size: number; spacing: number; transition: number; color: Color; weightClassification: number; weightElevation: number; weightIntensity: number; weightReturnNumber: number; weightRGB: number; weightSourceID: number; opacityAttenuation: number; filterByNormalThreshold: number; highlightedPointCoordinate: Vector3; highlightedPointColor: Vector4; enablePointHighlighting: boolean; highlightedPointScale: number; viewScale: number; useClipBox: boolean; useClipSphere: boolean; weighted: boolean; pointColorType: PointColorType; pointSizeType: PointSizeType; clipMode: ClipMode; useEDL: boolean; shape: PointShape; treeType: TreeType; pointOpacityType: PointOpacityType; useFilterByNormal: boolean; highlightPoint: boolean; inputColorEncoding: ColorEncoding; outputColorEncoding: ColorEncoding; private useLogDepth; attributes: { position: { type: string; value: any[]; }; color: { type: string; value: any[]; }; normal: { type: string; value: any[]; }; intensity: { type: string; value: any[]; }; classification: { type: string; value: any[]; }; returnNumber: { type: string; value: any[]; }; numberOfReturns: { type: string; value: any[]; }; pointSourceID: { type: string; value: any[]; }; indices: { type: string; value: any[]; }; }; newFormat: boolean; constructor(parameters?: Partial); dispose(): void; clearVisibleNodeTextureOffsets(): void; updateShaderSource(): void; applyDefines(shaderSrc: string): string; setClipBoxes(clipBoxes: IClipBox[]): void; setClipSpheres(clipSpheres: IClipSphere[]): void; /** * Syncs the inherited `clippingPlanes` property to internal shader uniforms. * Called automatically each frame from `updateMaterial()`. */ private syncClippingPlanes; get gradient(): IGradient; set gradient(value: IGradient); get classification(): IClassification; set classification(value: IClassification); private recomputeClassification; get elevationRange(): [number, number]; set elevationRange(value: [number, number]); getUniform(name: K): IPointCloudMaterialUniforms[K]['value']; setUniform(name: K, value: IPointCloudMaterialUniforms[K]['value']): void; updateMaterial(octree: PointCloudOctree, visibleNodes: PointCloudOctreeNode[], camera: Camera, renderer: WebGLRenderer): void; private updateVisibilityTextureData; static makeOnBeforeRender(octree: PointCloudOctree, node: PointCloudOctreeNode, pcIndex?: number): (_renderer: WebGLRenderer, _scene: Scene, _camera: Camera, _geometry: BufferGeometry, material: Material) => void; }