viral-viewer-2 6.9.3 → 6.9.5
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/{batched-mesh-simplifier-BIpHfnmJ.mjs → batched-mesh-simplifier-Ca5qqBRx.mjs} +1 -1
- package/dist/components/custom-objects/viral-batched-mesh.d.ts +104 -34
- package/dist/components/custom-objects/viral-instanced-mesh-v2.d.ts +98 -15
- package/dist/components/custom-objects/viral-merged-model.d.ts +35 -0
- package/dist/components/post-processing/post-processing-renderer.d.ts +52 -1
- package/dist/components/post-processing/screen-space-edges-pass.d.ts +68 -0
- package/dist/components/visibility-manager/viral-visibility-manager.d.ts +71 -0
- package/dist/components/worker/load-element-batch.worker.d.ts +8 -1
- package/dist/{index-Dz6pKFVp.mjs → index-2UhYEXGe.mjs} +7438 -6371
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -56,10 +56,23 @@ export declare class ViralVisibilityManager {
|
|
|
56
56
|
b: number;
|
|
57
57
|
};
|
|
58
58
|
}[];
|
|
59
|
+
/**
|
|
60
|
+
* Select elements (replaces current selection)
|
|
61
|
+
*/
|
|
59
62
|
selectElements(elements: {
|
|
60
63
|
modelId: string;
|
|
61
64
|
elementId: string;
|
|
62
65
|
}[]): void;
|
|
66
|
+
/**
|
|
67
|
+
* Add elements to current selection (multi-select with Shift)
|
|
68
|
+
*/
|
|
69
|
+
addToSelection(elements: {
|
|
70
|
+
modelId: string;
|
|
71
|
+
elementId: string;
|
|
72
|
+
}[]): void;
|
|
73
|
+
/**
|
|
74
|
+
* Unselect all elements
|
|
75
|
+
*/
|
|
63
76
|
unselectElements(): void;
|
|
64
77
|
isolateModelId: string;
|
|
65
78
|
isolateModel(isolateModelIds?: string[]): void;
|
|
@@ -73,6 +86,33 @@ export declare class ViralVisibilityManager {
|
|
|
73
86
|
private _updateLightShadowCamera;
|
|
74
87
|
enableEdge(): void;
|
|
75
88
|
disableEdge(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Enable screen-space edge detection (Speckle-style)
|
|
91
|
+
*
|
|
92
|
+
* This is much more efficient than geometry-based edges because:
|
|
93
|
+
* - No edge geometry is generated (constant GPU memory)
|
|
94
|
+
* - Cost is fixed regardless of model complexity (~2-3ms per frame)
|
|
95
|
+
* - Instanced meshes don't explode into per-instance edges
|
|
96
|
+
* - Edges are detected on-the-fly using depth/normal/ID discontinuities
|
|
97
|
+
*
|
|
98
|
+
* @param mode - 'shaded' (subtle edges) or 'pen' (technical drawing style)
|
|
99
|
+
*/
|
|
100
|
+
enableScreenSpaceEdge(mode?: 'shaded' | 'pen'): void;
|
|
101
|
+
/**
|
|
102
|
+
* Disable screen-space edge detection
|
|
103
|
+
*/
|
|
104
|
+
disableScreenSpaceEdge(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Configure screen-space edge detection
|
|
107
|
+
*/
|
|
108
|
+
configureScreenSpaceEdge(options: {
|
|
109
|
+
color?: number;
|
|
110
|
+
opacity?: number;
|
|
111
|
+
thickness?: number;
|
|
112
|
+
depthEdges?: boolean;
|
|
113
|
+
normalEdges?: boolean;
|
|
114
|
+
objectIdEdges?: boolean;
|
|
115
|
+
}): void;
|
|
76
116
|
enableAllWhite(): void;
|
|
77
117
|
disableAllWhite(): void;
|
|
78
118
|
enableAmbientOcclusion(): void;
|
|
@@ -116,6 +156,37 @@ export declare class ViralVisibilityManager {
|
|
|
116
156
|
*/
|
|
117
157
|
enableSampling(numberOfSampling?: number): void;
|
|
118
158
|
disableSampling(): void;
|
|
159
|
+
/**
|
|
160
|
+
* Set opacity for specific elements
|
|
161
|
+
* @param elements - Elements to set opacity for
|
|
162
|
+
* @param opacity - Opacity value (0-1)
|
|
163
|
+
*/
|
|
164
|
+
setElementOpacity(elements: {
|
|
165
|
+
modelId: string;
|
|
166
|
+
elementId: string;
|
|
167
|
+
}[], opacity: number): void;
|
|
168
|
+
/**
|
|
169
|
+
* Set elements to "ghost" mode (semi-transparent)
|
|
170
|
+
* @param elements - Elements to ghost
|
|
171
|
+
* @param ghostOpacity - Opacity for ghosted elements (default 0.1)
|
|
172
|
+
*/
|
|
173
|
+
setElementGhost(elements: {
|
|
174
|
+
modelId: string;
|
|
175
|
+
elementId: string;
|
|
176
|
+
}[], ghostOpacity?: number): void;
|
|
177
|
+
/**
|
|
178
|
+
* Ghost all elements EXCEPT the specified ones (highlight effect)
|
|
179
|
+
* @param elements - Elements to keep fully opaque
|
|
180
|
+
* @param ghostOpacity - Opacity for all other elements (default 0.1)
|
|
181
|
+
*/
|
|
182
|
+
ghostExcept(elements: {
|
|
183
|
+
modelId: string;
|
|
184
|
+
elementId: string;
|
|
185
|
+
}[], ghostOpacity?: number): void;
|
|
186
|
+
/**
|
|
187
|
+
* Reset all elements to full opacity
|
|
188
|
+
*/
|
|
189
|
+
resetElementOpacity(): void;
|
|
119
190
|
generateLOD(): void;
|
|
120
191
|
private _batchColors;
|
|
121
192
|
private _originalBatchMaterials;
|
|
@@ -41,9 +41,16 @@ export declare class LoadElementBatchWorker {
|
|
|
41
41
|
private createSingleMergedMesh;
|
|
42
42
|
private createSingleInstancedMesh;
|
|
43
43
|
/**
|
|
44
|
-
* Create optimized material for merging
|
|
44
|
+
* Create optimized material for merging with per-element opacity support
|
|
45
|
+
* Uses onBeforeCompile to inject custom shader code for RGBA vertex colors
|
|
45
46
|
*/
|
|
46
47
|
private createOptimizedMaterial;
|
|
48
|
+
/**
|
|
49
|
+
* 🎨 Inject custom shader modifications for per-element opacity
|
|
50
|
+
* This modifies the material's shaders to support RGBA vertex colors
|
|
51
|
+
* where the alpha channel controls per-element transparency
|
|
52
|
+
*/
|
|
53
|
+
private injectPerElementOpacityShader;
|
|
47
54
|
/**
|
|
48
55
|
* Throttled render to avoid excessive render calls
|
|
49
56
|
*/
|