@rings-webgpu/core 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rings.es.js +626 -415
- package/dist/rings.es.js.map +3 -3
- package/dist/rings.es.max.js +1190 -520
- package/dist/rings.umd.js +554 -343
- package/dist/rings.umd.js.map +3 -3
- package/dist/rings.umd.max.js +1193 -519
- package/dist/types/assets/shader/core/base/Common_frag.d.ts +3 -0
- package/dist/types/assets/shader/core/struct/VertexAttributes.d.ts +3 -0
- package/dist/types/assets/shader/lines/FatLineShader.d.ts +5 -0
- package/dist/types/assets/shader/materials/program/ShadowMapping_frag.d.ts +3 -0
- package/dist/types/components/renderer/FatLineRenderer.d.ts +38 -0
- package/dist/types/core/geometry/FatLineGeometry.d.ts +48 -0
- package/dist/types/index.d.ts +7 -1
- package/dist/types/loader/parser/prefab/mats/shader/FatLineShader.d.ts +11 -0
- package/dist/types/loader/parser/prefab/mats/shader/GSplatShader.d.ts +12 -0
- package/dist/types/materials/FatLineMaterial.d.ts +57 -0
- package/dist/types/materials/GSplatMaterial.d.ts +5 -0
- package/package.json +1 -1
- /package/dist/types/assets/shader/{materials → gsplat}/GSplatShader.d.ts +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Object3D } from "../../core/entities/Object3D";
|
|
2
|
+
import { RenderNode } from "./RenderNode";
|
|
3
|
+
import { FatLineMaterial } from "../../materials/FatLineMaterial";
|
|
4
|
+
import { FatLineGeometry } from "../../core/geometry/FatLineGeometry";
|
|
5
|
+
import { View3D } from "../../core/View3D";
|
|
6
|
+
import { PassType } from "../../gfx/renderJob/passRenderer/state/PassType";
|
|
7
|
+
import { RendererPassState } from "../../gfx/renderJob/passRenderer/state/RendererPassState";
|
|
8
|
+
import { ClusterLightingBuffer } from "../../gfx/renderJob/passRenderer/cluster/ClusterLightingBuffer";
|
|
9
|
+
/**
|
|
10
|
+
* FatLine Renderer Component
|
|
11
|
+
* Specialized renderer for FatLine geometries that automatically updates
|
|
12
|
+
* model matrix and resolution uniforms each frame
|
|
13
|
+
*
|
|
14
|
+
* @group Components
|
|
15
|
+
*/
|
|
16
|
+
export declare class FatLineRenderer extends RenderNode {
|
|
17
|
+
private _fatLineMaterial;
|
|
18
|
+
private _fatLineGeometry;
|
|
19
|
+
constructor();
|
|
20
|
+
onEnable(): void;
|
|
21
|
+
onDisable(): void;
|
|
22
|
+
cloneTo(obj: Object3D): void;
|
|
23
|
+
copyComponent(from: this): this;
|
|
24
|
+
/**
|
|
25
|
+
* Set FatLine geometry
|
|
26
|
+
*/
|
|
27
|
+
set geometry(value: FatLineGeometry);
|
|
28
|
+
get geometry(): FatLineGeometry;
|
|
29
|
+
/**
|
|
30
|
+
* Set FatLine material
|
|
31
|
+
*/
|
|
32
|
+
set material(value: FatLineMaterial);
|
|
33
|
+
get material(): FatLineMaterial;
|
|
34
|
+
/**
|
|
35
|
+
* Override nodeUpdate to automatically update FatLine-specific uniforms
|
|
36
|
+
*/
|
|
37
|
+
nodeUpdate(view: View3D, passType: PassType, renderPassState: RendererPassState, clusterLightingBuffer?: ClusterLightingBuffer): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { GeometryBase } from "./GeometryBase";
|
|
2
|
+
import { StorageGPUBuffer } from "../../gfx/graphics/webGpu/core/buffer/StorageGPUBuffer";
|
|
3
|
+
/**
|
|
4
|
+
* FatLine Geometry
|
|
5
|
+
* Using instance rendering, each line segment as an instance
|
|
6
|
+
* @group Geometry
|
|
7
|
+
*/
|
|
8
|
+
export declare class FatLineGeometry extends GeometryBase {
|
|
9
|
+
private _instanceBuffer;
|
|
10
|
+
private _instanceData;
|
|
11
|
+
private _instanceCount;
|
|
12
|
+
constructor();
|
|
13
|
+
/**
|
|
14
|
+
* Initialize base quad geometry (shared by all line segments)
|
|
15
|
+
* This is similar to ThreeJS LineSegmentsGeometry base geometry
|
|
16
|
+
*/
|
|
17
|
+
private initBaseGeometry;
|
|
18
|
+
/**
|
|
19
|
+
* Set line positions from continuous points array
|
|
20
|
+
* @param positions Array of positions [x1,y1,z1, x2,y2,z2, ...]
|
|
21
|
+
*/
|
|
22
|
+
setPositions(positions: Float32Array | number[]): this;
|
|
23
|
+
/**
|
|
24
|
+
* Set colors for line segments
|
|
25
|
+
* @param colors Array of colors [r1,g1,b1, r2,g2,b2, ...] for each point
|
|
26
|
+
*/
|
|
27
|
+
setColors(colors: Float32Array | number[]): this;
|
|
28
|
+
/**
|
|
29
|
+
* Compute bounding box from positions
|
|
30
|
+
*/
|
|
31
|
+
private computeBoundingBox;
|
|
32
|
+
/**
|
|
33
|
+
* Get instance data for GPU upload
|
|
34
|
+
*/
|
|
35
|
+
get instanceData(): Float32Array;
|
|
36
|
+
/**
|
|
37
|
+
* Get number of line segments (instances)
|
|
38
|
+
*/
|
|
39
|
+
get instanceCount(): number;
|
|
40
|
+
/**
|
|
41
|
+
* Get or create instance buffer
|
|
42
|
+
*/
|
|
43
|
+
get instanceBuffer(): StorageGPUBuffer;
|
|
44
|
+
/**
|
|
45
|
+
* Update instance buffer with new data
|
|
46
|
+
*/
|
|
47
|
+
updateInstanceBuffer(): void;
|
|
48
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export * from "./assets/shader/core/struct/VertexAttributeIndexShader";
|
|
|
64
64
|
export * from "./assets/shader/core/struct/VertexAttributes";
|
|
65
65
|
export * from "./assets/shader/env/ReflectionCG";
|
|
66
66
|
export * from "./assets/shader/glsl/Quad_glsl";
|
|
67
|
+
export * from "./assets/shader/gsplat/GSplatShader";
|
|
67
68
|
export * from "./assets/shader/lighting/BRDF_frag";
|
|
68
69
|
export * from "./assets/shader/lighting/BsDF_frag";
|
|
69
70
|
export * from "./assets/shader/lighting/BxDF_frag";
|
|
@@ -73,9 +74,9 @@ export * from "./assets/shader/lighting/IrradianceVolumeData_frag";
|
|
|
73
74
|
export * from "./assets/shader/lighting/Irradiance_frag";
|
|
74
75
|
export * from "./assets/shader/lighting/LightingFunction_frag";
|
|
75
76
|
export * from "./assets/shader/lighting/UnLit_frag";
|
|
77
|
+
export * from "./assets/shader/lines/FatLineShader";
|
|
76
78
|
export * from "./assets/shader/materials/ColorLitShader";
|
|
77
79
|
export * from "./assets/shader/materials/GIProbeShader";
|
|
78
|
-
export * from "./assets/shader/materials/GSplatShader";
|
|
79
80
|
export * from "./assets/shader/materials/GlassShader";
|
|
80
81
|
export * from "./assets/shader/materials/Hair_shader";
|
|
81
82
|
export * from "./assets/shader/materials/Lambert_shader";
|
|
@@ -179,6 +180,7 @@ export * from "./components/lights/LightData";
|
|
|
179
180
|
export * from "./components/lights/PointLight";
|
|
180
181
|
export * from "./components/lights/SpotLight";
|
|
181
182
|
export * from "./components/post/PostProcessingComponent";
|
|
183
|
+
export * from "./components/renderer/FatLineRenderer";
|
|
182
184
|
export * from "./components/renderer/GSplatRenderer";
|
|
183
185
|
export * from "./components/renderer/GlobalIlluminationComponent";
|
|
184
186
|
export * from "./components/renderer/InstanceDrawComponent";
|
|
@@ -212,6 +214,7 @@ export * from "./core/entities/Entity";
|
|
|
212
214
|
export * from "./core/entities/InstancedMesh";
|
|
213
215
|
export * from "./core/entities/Object3D";
|
|
214
216
|
export * from "./core/geometry/ExtrudeGeometry";
|
|
217
|
+
export * from "./core/geometry/FatLineGeometry";
|
|
215
218
|
export * from "./core/geometry/GeometryBase";
|
|
216
219
|
export * from "./core/geometry/GeometryIndicesBuffer";
|
|
217
220
|
export * from "./core/geometry/GeometryVertexBuffer";
|
|
@@ -432,6 +435,8 @@ export * from "./loader/parser/prefab/PrefabParser";
|
|
|
432
435
|
export * from "./loader/parser/prefab/PrefabStringUtil";
|
|
433
436
|
export * from "./loader/parser/prefab/PrefabTextureParser";
|
|
434
437
|
export * from "./loader/parser/prefab/mats/MaterialUtilities";
|
|
438
|
+
export * from "./loader/parser/prefab/mats/shader/FatLineShader";
|
|
439
|
+
export * from "./loader/parser/prefab/mats/shader/GSplatShader";
|
|
435
440
|
export * from "./loader/parser/prefab/mats/shader/LitSSSShader";
|
|
436
441
|
export * from "./loader/parser/prefab/mats/shader/LitShader";
|
|
437
442
|
export * from "./loader/parser/prefab/mats/shader/QuadShader";
|
|
@@ -454,6 +459,7 @@ export * from "./loader/parser/tileRenderer/TileSet";
|
|
|
454
459
|
export * from "./loader/parser/tileRenderer/TilesRenderer";
|
|
455
460
|
export * from "./materials/BlendMode";
|
|
456
461
|
export * from "./materials/ColorLitMaterial";
|
|
462
|
+
export * from "./materials/FatLineMaterial";
|
|
457
463
|
export * from "./materials/GIProbeMaterial";
|
|
458
464
|
export * from "./materials/GSplatMaterial";
|
|
459
465
|
export * from "./materials/LambertMaterial";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Shader } from "../../../../../gfx/graphics/webGpu/shader/Shader";
|
|
2
|
+
/**
|
|
3
|
+
* GSplat Shader
|
|
4
|
+
* Shader for rendering 3D Gaussian Splats
|
|
5
|
+
*/
|
|
6
|
+
export declare class GSplatShader extends Shader {
|
|
7
|
+
constructor();
|
|
8
|
+
/**
|
|
9
|
+
* Set default uniform values
|
|
10
|
+
*/
|
|
11
|
+
setDefault(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Material } from "./Material";
|
|
2
|
+
import { Color } from "../math/Color";
|
|
3
|
+
import { Vector2 } from "../math/Vector2";
|
|
4
|
+
import { Matrix4 } from "../math/Matrix4";
|
|
5
|
+
import { StorageGPUBuffer } from "../gfx/graphics/webGpu/core/buffer/StorageGPUBuffer";
|
|
6
|
+
/**
|
|
7
|
+
* FatLine Material
|
|
8
|
+
* Material for rendering thick lines
|
|
9
|
+
* Supports pixel-accurate line width and round endcaps
|
|
10
|
+
* @group Material
|
|
11
|
+
*/
|
|
12
|
+
export declare class FatLineMaterial extends Material {
|
|
13
|
+
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* Set instance buffer for line segments
|
|
16
|
+
* This should be called after setting the geometry
|
|
17
|
+
*/
|
|
18
|
+
setInstanceBuffer(buffer: StorageGPUBuffer): void;
|
|
19
|
+
/**
|
|
20
|
+
* Set model matrix for transforming line segments
|
|
21
|
+
* This should be updated each frame if the object moves
|
|
22
|
+
*/
|
|
23
|
+
setModelMatrix(matrix: Matrix4): void;
|
|
24
|
+
/**
|
|
25
|
+
* Set base color (tint color)
|
|
26
|
+
*/
|
|
27
|
+
set baseColor(color: Color);
|
|
28
|
+
/**
|
|
29
|
+
* Get base color (tint color)
|
|
30
|
+
*/
|
|
31
|
+
get baseColor(): Color;
|
|
32
|
+
/**
|
|
33
|
+
* Set line width in pixels
|
|
34
|
+
*/
|
|
35
|
+
set lineWidth(value: number);
|
|
36
|
+
/**
|
|
37
|
+
* Get line width in pixels
|
|
38
|
+
*/
|
|
39
|
+
get lineWidth(): number;
|
|
40
|
+
/**
|
|
41
|
+
* Set opacity (0-1)
|
|
42
|
+
*/
|
|
43
|
+
set opacity(value: number);
|
|
44
|
+
/**
|
|
45
|
+
* Get opacity (0-1)
|
|
46
|
+
*/
|
|
47
|
+
get opacity(): number;
|
|
48
|
+
/**
|
|
49
|
+
* Set viewport resolution for correct pixel-space calculations
|
|
50
|
+
* This should be set automatically by the renderer
|
|
51
|
+
*/
|
|
52
|
+
set resolution(value: Vector2);
|
|
53
|
+
/**
|
|
54
|
+
* Get viewport resolution
|
|
55
|
+
*/
|
|
56
|
+
get resolution(): Vector2;
|
|
57
|
+
}
|
|
@@ -3,6 +3,11 @@ import { Float16ArrayTexture } from "../textures/Float16ArrayTexture";
|
|
|
3
3
|
import { Uint8ArrayTexture } from "../textures/Uint8ArrayTexture";
|
|
4
4
|
import { Uint32ArrayTexture } from "../textures/Uint32ArrayTexture";
|
|
5
5
|
import { Matrix4 } from "../math/Matrix4";
|
|
6
|
+
/**
|
|
7
|
+
* GSplat Material
|
|
8
|
+
* Material for rendering 3D Gaussian Splats
|
|
9
|
+
* @group Material
|
|
10
|
+
*/
|
|
6
11
|
export declare class GSplatMaterial extends Material {
|
|
7
12
|
constructor();
|
|
8
13
|
setSplatTextures(splatColor: Uint8ArrayTexture, transformA: Uint32ArrayTexture, transformB: Float16ArrayTexture, texParams: Float32Array, splatOrder?: Uint32ArrayTexture): void;
|
package/package.json
CHANGED
|
File without changes
|