Skip to content

Commit 1ca51d6

Browse files
committed
Format code
1 parent 4de499a commit 1ca51d6

3 files changed

Lines changed: 203 additions & 94 deletions

File tree

source/materials/blur-material.ts

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,44 @@
11
import {ShaderMaterial, Texture} from 'three';
22
import {IUniform} from './types';
33

4-
// see http://john-chapman-graphics.blogspot.co.at/2013/01/ssao-tutorial.html
5-
4+
/**
5+
* Uniforms interface for blur material shader.
6+
*
7+
* Defines the uniform variables that control blur rendering parameters.
8+
*
9+
* Check http://john-chapman-graphics.blogspot.co.at/2013/01/ssao-tutorial.html
10+
*/
611
export interface IBlurMaterialUniforms {
7-
[name: string]: IUniform<any>;
8-
screenWidth: IUniform<number>;
9-
screenHeight: IUniform<number>;
10-
map: IUniform<Texture | null>;
12+
/**
13+
* Generic uniform property accessor.
14+
* @param name - The name of the uniform property
15+
*/
16+
[name: string]: IUniform<any>;
17+
18+
/**
19+
* Screen width in pixels.
20+
* Used to calculate blur kernel size and sampling coordinates.
21+
*/
22+
screenWidth: IUniform<number>;
23+
24+
/**
25+
* Screen height in pixels.
26+
* Used to calculate blur kernel size and sampling coordinates.
27+
*/
28+
screenHeight: IUniform<number>;
29+
30+
/**
31+
* Input texture to be blurred.
32+
* Can be null if no texture is currently bound.
33+
*/
34+
map: IUniform<Texture | null>;
1135
}
1236

1337
export class BlurMaterial extends ShaderMaterial
1438
{
1539
// vertexShader = require('./shaders/blur.vert');
1640
// fragmentShader = require('./shaders/blur.frag');
41+
1742
uniforms: IBlurMaterialUniforms = {
1843
screenWidth: {type: 'f', value: 0},
1944
screenHeight: {type: 'f', value: 0},

source/materials/point-cloud-material.ts

Lines changed: 139 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -46,66 +46,149 @@ import {ColorEncoding} from './color-encoding';
4646
const VertShader = require('./shaders/pointcloud.vs').default;
4747
const FragShader = require('./shaders/pointcloud.fs').default;
4848

49+
/**
50+
* Configuration parameters for point cloud material rendering.
51+
*
52+
* @interface IPointCloudMaterialParameters
53+
*/
4954
export interface IPointCloudMaterialParameters {
50-
size: number;
51-
minSize: number;
52-
maxSize: number;
53-
treeType: TreeType;
54-
newFormat: boolean;
55+
/**
56+
* The base size of points in the point cloud.
57+
*/
58+
size: number;
59+
60+
/**
61+
* The minimum allowed size for points when scaling.
62+
*/
63+
minSize: number;
64+
65+
/**
66+
* The maximum allowed size for points when scaling.
67+
*/
68+
maxSize: number;
69+
70+
/**
71+
* The type of tree structure used for organizing the point cloud data.
72+
*/
73+
treeType: TreeType;
74+
75+
/**
76+
* Whether to use the new format for point cloud data processing.
77+
*/
78+
newFormat: boolean;
5579
}
5680

81+
82+
/**
83+
* Interface defining uniforms for point cloud material rendering in WebGL shaders.
84+
* These uniforms control various aspects of point cloud visualization including
85+
* appearance, filtering, transformations, and rendering parameters.
86+
*
87+
* @interface IPointCloudMaterialUniforms
88+
*/
5789
export interface IPointCloudMaterialUniforms {
58-
bbSize: IUniform<[number, number, number]>;
59-
blendDepthSupplement: IUniform<number>;
60-
blendHardness: IUniform<number>;
61-
classificationLUT: IUniform<Texture>;
62-
clipBoxCount: IUniform<number>;
63-
clipBoxes: IUniform<Float32Array>;
64-
depthMap: IUniform<Texture | null>;
65-
diffuse: IUniform<[number, number, number]>;
66-
fov: IUniform<number>;
67-
gradient: IUniform<Texture>;
68-
heightMax: IUniform<number>;
69-
heightMin: IUniform<number>;
70-
intensityBrightness: IUniform<number>;
71-
intensityContrast: IUniform<number>;
72-
intensityGamma: IUniform<number>;
73-
intensityRange: IUniform<[number, number]>;
74-
level: IUniform<number>;
75-
maxSize: IUniform<number>;
76-
minSize: IUniform<number>;
77-
octreeSize: IUniform<number>;
78-
opacity: IUniform<number>;
79-
pcIndex: IUniform<number>;
80-
rgbBrightness: IUniform<number>;
81-
rgbContrast: IUniform<number>;
82-
rgbGamma: IUniform<number>;
83-
screenHeight: IUniform<number>;
84-
screenWidth: IUniform<number>;
85-
orthoHeight: IUniform<number>;
86-
orthoWidth: IUniform<number>;
87-
useOrthographicCamera: IUniform<boolean>;
88-
far: IUniform<number>;
89-
size: IUniform<number>;
90-
spacing: IUniform<number>;
91-
toModel: IUniform<number[]>;
92-
transition: IUniform<number>;
93-
uColor: IUniform<Color>;
94-
visibleNodes: IUniform<Texture>;
95-
vnStart: IUniform<number>;
96-
wClassification: IUniform<number>;
97-
wElevation: IUniform<number>;
98-
wIntensity: IUniform<number>;
99-
wReturnNumber: IUniform<number>;
100-
wRGB: IUniform<number>;
101-
wSourceID: IUniform<number>;
102-
opacityAttenuation: IUniform<number>;
103-
filterByNormalThreshold: IUniform<number>;
104-
highlightedPointCoordinate: IUniform<Vector3>;
105-
highlightedPointColor: IUniform<Vector4>;
106-
enablePointHighlighting: IUniform<boolean>;
107-
highlightedPointScale: IUniform<number>;
108-
viewScale: IUniform<number>;
90+
/** Bounding box size as [width, height, depth] */
91+
bbSize: IUniform<[number, number, number]>;
92+
/** Supplement value for depth blending calculations */
93+
blendDepthSupplement: IUniform<number>;
94+
/** Hardness factor for blending operations */
95+
blendHardness: IUniform<number>;
96+
/** Lookup texture for point classification rendering */
97+
classificationLUT: IUniform<Texture>;
98+
/** Number of active clipping boxes */
99+
clipBoxCount: IUniform<number>;
100+
/** Array containing clipping box parameters */
101+
clipBoxes: IUniform<Float32Array>;
102+
/** Depth map texture for depth-based effects, null if not used */
103+
depthMap: IUniform<Texture | null>;
104+
/** Diffuse color as RGB values [r, g, b] */
105+
diffuse: IUniform<[number, number, number]>;
106+
/** Field of view angle in radians */
107+
fov: IUniform<number>;
108+
/** Gradient texture for color mapping */
109+
gradient: IUniform<Texture>;
110+
/** Maximum height value for elevation-based coloring */
111+
heightMax: IUniform<number>;
112+
/** Minimum height value for elevation-based coloring */
113+
heightMin: IUniform<number>;
114+
/** Brightness adjustment for intensity values */
115+
intensityBrightness: IUniform<number>;
116+
/** Contrast adjustment for intensity values */
117+
intensityContrast: IUniform<number>;
118+
/** Gamma correction for intensity values */
119+
intensityGamma: IUniform<number>;
120+
/** Intensity range as [min, max] values */
121+
intensityRange: IUniform<[number, number]>;
122+
/** Current level of detail */
123+
level: IUniform<number>;
124+
/** Maximum point size in pixels */
125+
maxSize: IUniform<number>;
126+
/** Minimum point size in pixels */
127+
minSize: IUniform<number>;
128+
/** Size of the octree structure */
129+
octreeSize: IUniform<number>;
130+
/** Overall opacity of the point cloud (0.0 to 1.0) */
131+
opacity: IUniform<number>;
132+
/** Point cloud index identifier */
133+
pcIndex: IUniform<number>;
134+
/** Brightness adjustment for RGB color values */
135+
rgbBrightness: IUniform<number>;
136+
/** Contrast adjustment for RGB color values */
137+
rgbContrast: IUniform<number>;
138+
/** Gamma correction for RGB color values */
139+
rgbGamma: IUniform<number>;
140+
/** Screen height in pixels */
141+
screenHeight: IUniform<number>;
142+
/** Screen width in pixels */
143+
screenWidth: IUniform<number>;
144+
/** Orthographic camera height */
145+
orthoHeight: IUniform<number>;
146+
/** Orthographic camera width */
147+
orthoWidth: IUniform<number>;
148+
/** Flag indicating whether orthographic camera is being used */
149+
useOrthographicCamera: IUniform<boolean>;
150+
/** Far clipping plane distance */
151+
far: IUniform<number>;
152+
/** Base point size */
153+
size: IUniform<number>;
154+
/** Spacing between points */
155+
spacing: IUniform<number>;
156+
/** Transformation matrix to model space */
157+
toModel: IUniform<number[]>;
158+
/** Transition factor for animations or interpolations */
159+
transition: IUniform<number>;
160+
/** Color uniform for material */
161+
uColor: IUniform<Color>;
162+
/** Texture containing visible node information */
163+
visibleNodes: IUniform<Texture>;
164+
/** Starting index for visible nodes */
165+
vnStart: IUniform<number>;
166+
/** Weight factor for classification-based coloring */
167+
wClassification: IUniform<number>;
168+
/** Weight factor for elevation-based coloring */
169+
wElevation: IUniform<number>;
170+
/** Weight factor for intensity-based coloring */
171+
wIntensity: IUniform<number>;
172+
/** Weight factor for return number-based coloring */
173+
wReturnNumber: IUniform<number>;
174+
/** Weight factor for RGB color contribution */
175+
wRGB: IUniform<number>;
176+
/** Weight factor for source ID-based coloring */
177+
wSourceID: IUniform<number>;
178+
/** Opacity attenuation factor based on distance or other criteria */
179+
opacityAttenuation: IUniform<number>;
180+
/** Threshold value for normal-based point filtering */
181+
filterByNormalThreshold: IUniform<number>;
182+
/** 3D coordinate of the highlighted point */
183+
highlightedPointCoordinate: IUniform<Vector3>;
184+
/** RGBA color for highlighted point rendering */
185+
highlightedPointColor: IUniform<Vector4>;
186+
/** Flag to enable or disable point highlighting feature */
187+
enablePointHighlighting: IUniform<boolean>;
188+
/** Scale factor for highlighted point size */
189+
highlightedPointScale: IUniform<number>;
190+
/** Scale factor for view-dependent sizing */
191+
viewScale: IUniform<number>;
109192
}
110193

111194
const TREE_TYPE_DEFS = {

0 commit comments

Comments
 (0)