@onerjs/core 8.51.6 → 8.51.8
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/Cameras/inputMapper.js +13 -9
- package/Cameras/inputMapper.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.views.pure.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.views.types.d.ts +2 -1
- package/Engines/AbstractEngine/abstractEngine.views.types.js.map +1 -1
- package/Engines/abstractEngine.pure.js +11 -4
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.pure.d.ts +23 -0
- package/Engines/engine.pure.js +96 -1
- package/Engines/engine.pure.js.map +1 -1
- package/Engines/nativeEngine.pure.d.ts +4 -0
- package/Engines/nativeEngine.pure.js +6 -0
- package/Engines/nativeEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +21 -0
- package/Engines/thinNativeEngine.pure.js +119 -4
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +21 -0
- package/Engines/webgpuEngine.pure.js +46 -1
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.d.ts +5 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.js +8 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +278 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +718 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/pure.d.ts +1 -0
- package/Materials/GaussianSplatting/pure.js +1 -0
- package/Materials/GaussianSplatting/pure.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +11 -1
- package/Materials/Textures/internalTexture.js +23 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Materials/pure.d.ts +1 -0
- package/Materials/pure.js +1 -0
- package/Materials/pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.d.ts +7 -0
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.js +8 -0
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.d.ts +147 -0
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.js +257 -0
- package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +11 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +31 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/pure.d.ts +1 -0
- package/Meshes/GaussianSplatting/pure.js +1 -0
- package/Meshes/GaussianSplatting/pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.js +3 -0
- package/Meshes/abstractMesh.pure.js.map +1 -1
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/pure.d.ts +1 -0
- package/Meshes/pure.js +1 -0
- package/Meshes/pure.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +33 -10
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +20 -1
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/picking.fragment.js +4 -1
- package/Shaders/picking.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +33 -10
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +21 -2
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/SmartAssets/index.d.ts +2 -2
- package/SmartAssets/index.js +2 -1
- package/SmartAssets/index.js.map +1 -1
- package/SmartAssets/pure.d.ts +1 -1
- package/SmartAssets/pure.js +2 -1
- package/SmartAssets/pure.js.map +1 -1
- package/SmartAssets/smartAssetManager.js +9 -0
- package/SmartAssets/smartAssetManager.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.js.map +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-exports pure implementation and applies runtime side effects.
|
|
3
|
+
* Import gaussianSplattingDebugMaterialPlugin.pure for tree-shakeable, side-effect-free usage.
|
|
4
|
+
*/
|
|
5
|
+
export * from "./gaussianSplattingDebugMaterialPlugin.pure.js";
|
|
6
|
+
import { RegisterGaussianSplattingDebugMaterialPlugin } from "./gaussianSplattingDebugMaterialPlugin.pure.js";
|
|
7
|
+
RegisterGaussianSplattingDebugMaterialPlugin();
|
|
8
|
+
//# sourceMappingURL=gaussianSplattingDebugMaterialPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianSplattingDebugMaterialPlugin.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,6CAA6C,CAAC;AAE5D,OAAO,EAAE,4CAA4C,EAAE,MAAM,6CAA6C,CAAC;AAC3G,4CAA4C,EAAE,CAAC","sourcesContent":["/**\n * Re-exports pure implementation and applies runtime side effects.\n * Import gaussianSplattingDebugMaterialPlugin.pure for tree-shakeable, side-effect-free usage.\n */\nexport * from \"./gaussianSplattingDebugMaterialPlugin.pure\";\n\nimport { RegisterGaussianSplattingDebugMaterialPlugin } from \"./gaussianSplattingDebugMaterialPlugin.pure\";\nRegisterGaussianSplattingDebugMaterialPlugin();\n"]}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { type Nullable } from "../../types.js";
|
|
3
|
+
import { type Scene } from "../../scene.js";
|
|
4
|
+
import { type AbstractEngine } from "../../Engines/abstractEngine.js";
|
|
5
|
+
import { type SubMesh } from "../../Meshes/subMesh.js";
|
|
6
|
+
import { type UniformBuffer } from "../uniformBuffer.js";
|
|
7
|
+
import { MaterialDefines } from "../materialDefines.js";
|
|
8
|
+
import { MaterialPluginBase } from "../materialPluginBase.pure.js";
|
|
9
|
+
import { ShaderLanguage } from "../shaderLanguage.js";
|
|
10
|
+
import { type Vector3 } from "../../Maths/math.vector.js";
|
|
11
|
+
import { type GaussianSplattingMaterial } from "./gaussianSplattingMaterial.pure.js";
|
|
12
|
+
/** @internal */
|
|
13
|
+
declare class GaussianSplattingDebugDefines extends MaterialDefines {
|
|
14
|
+
/** Defines whether any debug feature is active */
|
|
15
|
+
GS_DBG_ENABLED: boolean;
|
|
16
|
+
/** Defines whether world-space clipping box is enabled (0: off, 1: on) */
|
|
17
|
+
GS_DBG_CLIP: number;
|
|
18
|
+
/** Defines whether opacity culling is enabled (0: off, 1: on) */
|
|
19
|
+
GS_DBG_CULL_OPACITY: number;
|
|
20
|
+
/** Defines whether size culling is enabled (0: off, 1: on) */
|
|
21
|
+
GS_DBG_CULL_SIZE: number;
|
|
22
|
+
/** Defines whether per-splat opacity scaling is enabled (0: off, 1: on) */
|
|
23
|
+
GS_DBG_OPACITY_SCALE: number;
|
|
24
|
+
/** Defines whether opacity saturation (flat disk) is enabled (0: off, 1: on) */
|
|
25
|
+
GS_DBG_OPACITY_SATURATE: number;
|
|
26
|
+
/** Defines whether the DC (base) SH color is included (0: off, 1: on) */
|
|
27
|
+
GS_DBG_SH_DC: number;
|
|
28
|
+
/** Defines whether SH band 1 contribution is included (0: off, 1: on) */
|
|
29
|
+
GS_DBG_SH_ORDER1: number;
|
|
30
|
+
/** Defines whether SH band 2 contribution is included (0: off, 1: on) */
|
|
31
|
+
GS_DBG_SH_ORDER2: number;
|
|
32
|
+
/** Defines whether SH band 3 contribution is included (0: off, 1: on) */
|
|
33
|
+
GS_DBG_SH_ORDER3: number;
|
|
34
|
+
/** Defines whether SH band 4 contribution is included (0: off, 1: on) */
|
|
35
|
+
GS_DBG_SH_ORDER4: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Per-part debug options for compound Gaussian splat meshes.
|
|
39
|
+
* Each field is optional; unset fields fall back to the global setting on the plugin,
|
|
40
|
+
* and if that is also unset, a neutral value is used (no culling, full SH, etc.).
|
|
41
|
+
*/
|
|
42
|
+
export interface IGaussianSplattingDebugOptions {
|
|
43
|
+
/** World-space axis-aligned clipping box, or null to disable. */
|
|
44
|
+
clippingBox: Nullable<{
|
|
45
|
+
min: Vector3;
|
|
46
|
+
max: Vector3;
|
|
47
|
+
}>;
|
|
48
|
+
/** Opacity culling range [0..1], or null to disable. */
|
|
49
|
+
opacityCulling: Nullable<{
|
|
50
|
+
min: number;
|
|
51
|
+
max: number;
|
|
52
|
+
}>;
|
|
53
|
+
/** Size culling range, or null to disable. */
|
|
54
|
+
sizeCulling: Nullable<{
|
|
55
|
+
min: number;
|
|
56
|
+
max: number;
|
|
57
|
+
}>;
|
|
58
|
+
/** Scalar opacity multiplier. 1.0 = no change. */
|
|
59
|
+
opacityScale: number;
|
|
60
|
+
/** When true, replaces Gaussian falloff with flat disk opacity. */
|
|
61
|
+
opacitySaturate: boolean;
|
|
62
|
+
/** Include the DC (base) SH color. */
|
|
63
|
+
shDc: boolean;
|
|
64
|
+
/** Include SH band 1 contribution. */
|
|
65
|
+
shOrder1: boolean;
|
|
66
|
+
/** Include SH band 2 contribution. */
|
|
67
|
+
shOrder2: boolean;
|
|
68
|
+
/** Include SH band 3 contribution. */
|
|
69
|
+
shOrder3: boolean;
|
|
70
|
+
/** Include SH band 4 contribution. */
|
|
71
|
+
shOrder4: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Debug plugin for GaussianSplattingMaterial.
|
|
75
|
+
* Provides runtime controls for clipping, opacity/size culling, opacity scaling,
|
|
76
|
+
* opacity saturation, and per-SH-order toggling. All features are gated behind
|
|
77
|
+
* the GS_DBG_ENABLED shader define — when every option is at its default value
|
|
78
|
+
* the define is absent and the shader compiles to identical code as without the plugin.
|
|
79
|
+
*
|
|
80
|
+
* In compound mode (partCount \> 0), per-part overrides can be set via setPartOptions().
|
|
81
|
+
* Global settings act as defaults; per-part settings override them for that part index.
|
|
82
|
+
*/
|
|
83
|
+
export declare class GaussianSplattingDebugMaterialPlugin extends MaterialPluginBase {
|
|
84
|
+
private _clippingBox;
|
|
85
|
+
private _opacityCulling;
|
|
86
|
+
private _sizeCulling;
|
|
87
|
+
private _opacityScale;
|
|
88
|
+
private _opacitySaturate;
|
|
89
|
+
private _shDc;
|
|
90
|
+
private _shOrder1;
|
|
91
|
+
private _shOrder2;
|
|
92
|
+
private _shOrder3;
|
|
93
|
+
private _shOrder4;
|
|
94
|
+
private _partCount;
|
|
95
|
+
private _partClippingBoxes;
|
|
96
|
+
private _partOpacityCullings;
|
|
97
|
+
private _partSizeCullings;
|
|
98
|
+
private _partOpacityScales;
|
|
99
|
+
private _partOpacitySaturates;
|
|
100
|
+
private _partShDcs;
|
|
101
|
+
private _partShOrder1s;
|
|
102
|
+
private _partShOrder2s;
|
|
103
|
+
private _partShOrder3s;
|
|
104
|
+
private _partShOrder4s;
|
|
105
|
+
private _dbgPartDataTexture;
|
|
106
|
+
private _textureDirty;
|
|
107
|
+
private _maxPartCount;
|
|
108
|
+
/**
|
|
109
|
+
* Creates a new GaussianSplattingDebugMaterialPlugin.
|
|
110
|
+
* @param material The GaussianSplattingMaterial to attach the plugin to.
|
|
111
|
+
*/
|
|
112
|
+
constructor(material: GaussianSplattingMaterial);
|
|
113
|
+
private _isAnyFeatureActive;
|
|
114
|
+
private _markDirty;
|
|
115
|
+
/**
|
|
116
|
+
* Number of parts in compound mode. Set automatically by GaussianSplattingDebugger.addMesh().
|
|
117
|
+
* When 0 (non-compound), setPartOptions() logs an error.
|
|
118
|
+
* @returns the part count
|
|
119
|
+
*/
|
|
120
|
+
get partCount(): number;
|
|
121
|
+
set partCount(count: number);
|
|
122
|
+
/**
|
|
123
|
+
* Sets per-part debug overrides for the given part index.
|
|
124
|
+
* Only valid on compound meshes (partCount \> 0); logs an error otherwise.
|
|
125
|
+
* @param partIndex The zero-based part index.
|
|
126
|
+
* @param options Partial set of debug options to override for this part.
|
|
127
|
+
*/
|
|
128
|
+
setPartOptions(partIndex: number, options: Partial<IGaussianSplattingDebugOptions>): void;
|
|
129
|
+
/**
|
|
130
|
+
* Clears all per-part debug overrides for the given part index,
|
|
131
|
+
* falling back to global settings.
|
|
132
|
+
* @param partIndex The zero-based part index.
|
|
133
|
+
*/
|
|
134
|
+
clearPartOptions(partIndex: number): void;
|
|
135
|
+
/**
|
|
136
|
+
* World-space axis-aligned clipping box. Splats outside are not rendered.
|
|
137
|
+
* Set to null to disable clipping.
|
|
138
|
+
* Example: `{ min: new Vector3(-2,-2,-2), max: new Vector3(2,2,2) }`
|
|
139
|
+
*/
|
|
140
|
+
get clippingBox(): Nullable<{
|
|
141
|
+
min: Vector3;
|
|
142
|
+
max: Vector3;
|
|
143
|
+
}>;
|
|
144
|
+
set clippingBox(value: Nullable<{
|
|
145
|
+
min: Vector3;
|
|
146
|
+
max: Vector3;
|
|
147
|
+
}>);
|
|
148
|
+
/**
|
|
149
|
+
* Opacity culling range [0..1]. Splats whose stored opacity falls outside this
|
|
150
|
+
* range are not rendered. Set to null to disable.
|
|
151
|
+
*/
|
|
152
|
+
get opacityCulling(): Nullable<{
|
|
153
|
+
min: number;
|
|
154
|
+
max: number;
|
|
155
|
+
}>;
|
|
156
|
+
set opacityCulling(value: Nullable<{
|
|
157
|
+
min: number;
|
|
158
|
+
max: number;
|
|
159
|
+
}>);
|
|
160
|
+
/**
|
|
161
|
+
* Size culling range. Size is pow(|det(Σ)|, 1/6) of the 3D covariance matrix,
|
|
162
|
+
* equal to the geometric mean of the principal radii. Use GaussianSplattingMeshBase.splatSizeRange
|
|
163
|
+
* to find the asset's range. Set to null to disable.
|
|
164
|
+
*/
|
|
165
|
+
get sizeCulling(): Nullable<{
|
|
166
|
+
min: number;
|
|
167
|
+
max: number;
|
|
168
|
+
}>;
|
|
169
|
+
set sizeCulling(value: Nullable<{
|
|
170
|
+
min: number;
|
|
171
|
+
max: number;
|
|
172
|
+
}>);
|
|
173
|
+
/**
|
|
174
|
+
* Scalar multiplier applied to every splat's opacity after all other modifiers.
|
|
175
|
+
* 1.0 (default) = no change.
|
|
176
|
+
*/
|
|
177
|
+
get opacityScale(): number;
|
|
178
|
+
set opacityScale(value: number);
|
|
179
|
+
/**
|
|
180
|
+
* When true, replaces the Gaussian spatial falloff with a flat uniform opacity,
|
|
181
|
+
* making each splat appear as a solid disk with its raw alpha value.
|
|
182
|
+
*/
|
|
183
|
+
get opacitySaturate(): boolean;
|
|
184
|
+
set opacitySaturate(value: boolean);
|
|
185
|
+
/** Include the DC (base) color from colorsTexture. Default: true. */
|
|
186
|
+
get shDc(): boolean;
|
|
187
|
+
set shDc(value: boolean);
|
|
188
|
+
/** Include SH band 1 contribution. Default: true. */
|
|
189
|
+
get shOrder1(): boolean;
|
|
190
|
+
set shOrder1(value: boolean);
|
|
191
|
+
/** Include SH band 2 contribution. Default: true. */
|
|
192
|
+
get shOrder2(): boolean;
|
|
193
|
+
set shOrder2(value: boolean);
|
|
194
|
+
/** Include SH band 3 contribution. Default: true. */
|
|
195
|
+
get shOrder3(): boolean;
|
|
196
|
+
set shOrder3(value: boolean);
|
|
197
|
+
/** Include SH band 4 contribution. Default: true. */
|
|
198
|
+
get shOrder4(): boolean;
|
|
199
|
+
set shOrder4(value: boolean);
|
|
200
|
+
/**
|
|
201
|
+
* Adds the per-part debug data texture name to the sampler list so the effect can bind it.
|
|
202
|
+
* @param samplers the sampler list to populate
|
|
203
|
+
*/
|
|
204
|
+
getSamplers(samplers: string[]): void;
|
|
205
|
+
/** @returns the class name of this plugin */
|
|
206
|
+
getClassName(): string;
|
|
207
|
+
/**
|
|
208
|
+
* @param shaderLanguage the shader language to check
|
|
209
|
+
* @returns true for GLSL and WGSL
|
|
210
|
+
*/
|
|
211
|
+
isCompatible(shaderLanguage: ShaderLanguage): boolean;
|
|
212
|
+
/**
|
|
213
|
+
* Always ready — no async resources.
|
|
214
|
+
* @param _defines unused
|
|
215
|
+
* @param _scene unused
|
|
216
|
+
* @param _engine unused
|
|
217
|
+
* @param _subMesh unused
|
|
218
|
+
* @returns true
|
|
219
|
+
*/
|
|
220
|
+
isReadyForSubMesh(_defines: MaterialDefines, _scene: Scene, _engine: AbstractEngine, _subMesh: SubMesh): boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Sets shader defines from current property state. GS_DBG_ENABLED is set to true
|
|
223
|
+
* only when at least one feature is non-default, ensuring zero overhead otherwise.
|
|
224
|
+
* Sub-flags also check per-part arrays so compound-only overrides activate the correct
|
|
225
|
+
* code paths even when the global setting is at its default.
|
|
226
|
+
* @param defines the defines object
|
|
227
|
+
*/
|
|
228
|
+
prepareDefines(defines: GaussianSplattingDebugDefines): void;
|
|
229
|
+
/**
|
|
230
|
+
* Returns shader code injections for the debug features.
|
|
231
|
+
* @param shaderType "vertex" or "fragment"
|
|
232
|
+
* @param shaderLanguage GLSL or WGSL
|
|
233
|
+
* @returns map of injection-point name to injected code, or null
|
|
234
|
+
*/
|
|
235
|
+
getCustomCode(shaderType: string, shaderLanguage?: ShaderLanguage): Nullable<{
|
|
236
|
+
[pointName: string]: string;
|
|
237
|
+
}>;
|
|
238
|
+
private _getCustomCodeGLSL;
|
|
239
|
+
private _getCustomCodeWGSL;
|
|
240
|
+
/**
|
|
241
|
+
* Declares the non-compound scalar debug uniform names as external so the Effect can
|
|
242
|
+
* resolve their locations. WGSL uniforms are declared inline in getCustomCode() injections.
|
|
243
|
+
* @returns uniform descriptor with externalUniforms list
|
|
244
|
+
*/
|
|
245
|
+
getUniforms(): {
|
|
246
|
+
ubo?: Array<{
|
|
247
|
+
name: string;
|
|
248
|
+
size?: number;
|
|
249
|
+
type?: string;
|
|
250
|
+
arraySize?: number;
|
|
251
|
+
}>;
|
|
252
|
+
vertex?: string;
|
|
253
|
+
fragment?: string;
|
|
254
|
+
externalUniforms?: string[];
|
|
255
|
+
};
|
|
256
|
+
private _buildTextureData;
|
|
257
|
+
private _updateOrCreateTexture;
|
|
258
|
+
/**
|
|
259
|
+
* Binds uniform values each frame. Scalar uniforms are uploaded for non-compound mode;
|
|
260
|
+
* the per-part data texture is updated and bound for compound mode.
|
|
261
|
+
* @param _uniformBuffer unused
|
|
262
|
+
* @param _scene the current scene
|
|
263
|
+
* @param _engine unused
|
|
264
|
+
* @param subMesh the submesh being rendered
|
|
265
|
+
*/
|
|
266
|
+
bindForSubMesh(_uniformBuffer: UniformBuffer, _scene: Scene, _engine: AbstractEngine, subMesh: SubMesh): void;
|
|
267
|
+
/**
|
|
268
|
+
* Disposes the per-part data texture.
|
|
269
|
+
* @param _forceDisposeTextures unused; the LUT texture is always disposed as it is owned by this plugin
|
|
270
|
+
*/
|
|
271
|
+
dispose(_forceDisposeTextures?: boolean): void;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Register side effects for GaussianSplattingDebugMaterialPlugin.
|
|
275
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
276
|
+
*/
|
|
277
|
+
export declare function RegisterGaussianSplattingDebugMaterialPlugin(): void;
|
|
278
|
+
export {};
|