viral-viewer-2 7.2.3 → 7.2.4
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/components/custom-objects/viral-batched-mesh.d.ts +0 -12
- package/dist/components/custom-objects/viral-bim-world.d.ts +6 -0
- package/dist/components/custom-objects/viral-instanced-mesh-v2.d.ts +1 -20
- package/dist/components/post-processing/post-processing-renderer.d.ts +0 -41
- package/dist/components/post-processing/selection-outline-pass.d.ts +2 -0
- package/dist/components/visibility-manager/viral-visibility-manager.d.ts +8 -34
- package/dist/components/worker/merge-positions.worker.d.ts +19 -0
- package/dist/components/worker-script/merge-positions.script.d.ts +1 -0
- package/dist/index.mjs +856 -1071
- package/package.json +49 -49
- package/dist/components/post-processing/alpha-selection-outline-pass.d.ts +0 -49
- package/dist/components/post-processing/stencil-selection-outline-pass.d.ts +0 -54
package/package.json
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "viral-viewer-2",
|
|
3
|
-
"version": "7.2.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.mjs",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": [
|
|
8
|
-
"dist",
|
|
9
|
-
"LICENSE"
|
|
10
|
-
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"dev": "cd examples && npx vite",
|
|
13
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
-
"build": "npx tsc",
|
|
15
|
-
"bundle-webpack": "webpack --config webpack.config.js",
|
|
16
|
-
"bundle-vite": "npx vite build",
|
|
17
|
-
"deploy": "npm run bundle-vite && npm publish",
|
|
18
|
-
"lint": "biome check .",
|
|
19
|
-
"lint:fix": "biome check --write .",
|
|
20
|
-
"format": "biome format .",
|
|
21
|
-
"format:fix": "biome format . --write",
|
|
22
|
-
"check": "biome check .",
|
|
23
|
-
"check:fix": "biome check . --write"
|
|
24
|
-
},
|
|
25
|
-
"keywords": [],
|
|
26
|
-
"author": "",
|
|
27
|
-
"license": "ISC",
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"@biomejs/biome": "2.3.15",
|
|
30
|
-
"@types/node": "^20.2.5",
|
|
31
|
-
"@types/pako": "^2.0.0",
|
|
32
|
-
"@types/three": "^0.181.0",
|
|
33
|
-
"lil-gui": "^0.20.0",
|
|
34
|
-
"typescript": "^5.0.4",
|
|
35
|
-
"vite": "^5.1.1",
|
|
36
|
-
"vite-plugin-dts": "^3.6.1",
|
|
37
|
-
"vite-plugin-static-copy": "^1.0.1"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"camera-controls": "^2.9.0",
|
|
41
|
-
"meshoptimizer": "^0.25.0",
|
|
42
|
-
"n8ao": "^1.10.1",
|
|
43
|
-
"pako": "^2.1.0",
|
|
44
|
-
"postprocessing": "^6.38.0",
|
|
45
|
-
"potree-core-viral": "^0.3.0",
|
|
46
|
-
"three": "^0.181.2",
|
|
47
|
-
"three-mesh-bvh": "^0.9.2"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "viral-viewer-2",
|
|
3
|
+
"version": "7.2.4",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.mjs",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"LICENSE"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "cd examples && npx vite",
|
|
13
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
14
|
+
"build": "npx tsc",
|
|
15
|
+
"bundle-webpack": "webpack --config webpack.config.js",
|
|
16
|
+
"bundle-vite": "npx vite build",
|
|
17
|
+
"deploy": "npm run bundle-vite && npm publish",
|
|
18
|
+
"lint": "biome check .",
|
|
19
|
+
"lint:fix": "biome check --write .",
|
|
20
|
+
"format": "biome format .",
|
|
21
|
+
"format:fix": "biome format . --write",
|
|
22
|
+
"check": "biome check .",
|
|
23
|
+
"check:fix": "biome check . --write"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [],
|
|
26
|
+
"author": "",
|
|
27
|
+
"license": "ISC",
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@biomejs/biome": "2.3.15",
|
|
30
|
+
"@types/node": "^20.2.5",
|
|
31
|
+
"@types/pako": "^2.0.0",
|
|
32
|
+
"@types/three": "^0.181.0",
|
|
33
|
+
"lil-gui": "^0.20.0",
|
|
34
|
+
"typescript": "^5.0.4",
|
|
35
|
+
"vite": "^5.1.1",
|
|
36
|
+
"vite-plugin-dts": "^3.6.1",
|
|
37
|
+
"vite-plugin-static-copy": "^1.0.1"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"camera-controls": "^2.9.0",
|
|
41
|
+
"meshoptimizer": "^0.25.0",
|
|
42
|
+
"n8ao": "^1.10.1",
|
|
43
|
+
"pako": "^2.1.0",
|
|
44
|
+
"postprocessing": "^6.38.0",
|
|
45
|
+
"potree-core-viral": "^0.3.0",
|
|
46
|
+
"three": "^0.181.2",
|
|
47
|
+
"three-mesh-bvh": "^0.9.2"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { WebGLRenderer } from "three";
|
|
2
|
-
import { Color, type Vector2, type WebGLRenderTarget } from "three";
|
|
3
|
-
import { Pass } from "three/examples/jsm/postprocessing/Pass";
|
|
4
|
-
/**
|
|
5
|
-
* Alpha-Based Selection Outline Pass (FASTEST)
|
|
6
|
-
*
|
|
7
|
-
* This is the FASTEST possible selection outline implementation because:
|
|
8
|
-
* - ZERO extra render passes for selection mask
|
|
9
|
-
* - ZERO geometry copying
|
|
10
|
-
* - O(pixels) cost - same for 1 or 10,000 selected elements
|
|
11
|
-
*
|
|
12
|
-
* How it works:
|
|
13
|
-
* 1. Selected elements have their alpha set to a special value (SELECTION_ALPHA = 0.99)
|
|
14
|
-
* 2. This pass detects edges where alpha equals SELECTION_ALPHA
|
|
15
|
-
* 3. Applies outline effect at those edges
|
|
16
|
-
*
|
|
17
|
-
* Requirements:
|
|
18
|
-
* - ViralBatchedMesh/ViralInstancedMesh must set alpha = 0.99 for selected vertices
|
|
19
|
-
* - Must run after main render pass but before tone mapping
|
|
20
|
-
*/
|
|
21
|
-
export interface AlphaSelectionOutlineOptions {
|
|
22
|
-
/** Outline color (default: accent color) */
|
|
23
|
-
outlineColor: Color;
|
|
24
|
-
/** Outline opacity 0-1 (default: 1.0) */
|
|
25
|
-
outlineOpacity: number;
|
|
26
|
-
/** Outline thickness in pixels (default: 2.0) */
|
|
27
|
-
outlineThickness: number;
|
|
28
|
-
/** Alpha value that indicates selection (default: 0.99) */
|
|
29
|
-
selectionAlpha: number;
|
|
30
|
-
/** Tolerance for alpha detection (default: 0.005) */
|
|
31
|
-
alphaTolerance: number;
|
|
32
|
-
}
|
|
33
|
-
export declare const SELECTION_ALPHA = 0.99;
|
|
34
|
-
export declare class AlphaSelectionOutlinePass extends Pass {
|
|
35
|
-
private resolution;
|
|
36
|
-
private options;
|
|
37
|
-
private outlineMaterial;
|
|
38
|
-
private copyMaterial;
|
|
39
|
-
private fsQuad;
|
|
40
|
-
/** Fast bypass during camera movement */
|
|
41
|
-
bypass: boolean;
|
|
42
|
-
/** Whether there's any selection active */
|
|
43
|
-
hasSelection: boolean;
|
|
44
|
-
constructor(resolution: Vector2, options?: Partial<AlphaSelectionOutlineOptions>);
|
|
45
|
-
setOptions(options: Partial<AlphaSelectionOutlineOptions>): void;
|
|
46
|
-
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, _deltaTime?: number, _maskActive?: boolean): void;
|
|
47
|
-
setSize(width: number, height: number): void;
|
|
48
|
-
dispose(): void;
|
|
49
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { WebGLRenderer } from "three";
|
|
2
|
-
import { Color, type Vector2, type WebGLRenderTarget } from "three";
|
|
3
|
-
import { Pass } from "three/examples/jsm/postprocessing/Pass";
|
|
4
|
-
/**
|
|
5
|
-
* Stencil-Based Selection Outline Pass (FAST)
|
|
6
|
-
*
|
|
7
|
-
* This is a MUCH faster alternative to geometry-based selection outline.
|
|
8
|
-
* Instead of copying vertex data, it reads from a selection mask texture
|
|
9
|
-
* that's been written to during the main render pass.
|
|
10
|
-
*
|
|
11
|
-
* Performance: O(pixels) instead of O(selected_vertices)
|
|
12
|
-
* - 1000 selected elements = same cost as 1 selected element
|
|
13
|
-
* - No geometry copying
|
|
14
|
-
* - No extra mesh rendering
|
|
15
|
-
*
|
|
16
|
-
* Requirements:
|
|
17
|
-
* - Selection mask must be written by ViralBatchedMesh/ViralInstancedMesh during render
|
|
18
|
-
* - Main renderer must call updateSelectionMask() before this pass runs
|
|
19
|
-
*/
|
|
20
|
-
export interface StencilSelectionOutlineOptions {
|
|
21
|
-
/** Outline color (default: accent color) */
|
|
22
|
-
outlineColor: Color;
|
|
23
|
-
/** Outline opacity 0-1 (default: 1.0) */
|
|
24
|
-
outlineOpacity: number;
|
|
25
|
-
/** Outline thickness in pixels (default: 2.0) */
|
|
26
|
-
outlineThickness: number;
|
|
27
|
-
}
|
|
28
|
-
export declare class StencilSelectionOutlinePass extends Pass {
|
|
29
|
-
private resolution;
|
|
30
|
-
private options;
|
|
31
|
-
private selectionMaskTarget;
|
|
32
|
-
private outlineMaterial;
|
|
33
|
-
private copyMaterial;
|
|
34
|
-
private fsQuad;
|
|
35
|
-
bypass: boolean;
|
|
36
|
-
private hasSelection;
|
|
37
|
-
constructor(resolution: Vector2, options?: Partial<StencilSelectionOutlineOptions>);
|
|
38
|
-
/**
|
|
39
|
-
* Set the selection mask render target
|
|
40
|
-
* This should be called by the renderer after writing selection mask
|
|
41
|
-
*/
|
|
42
|
-
setSelectionMaskTarget(target: WebGLRenderTarget | null): void;
|
|
43
|
-
/**
|
|
44
|
-
* Set whether there's an active selection
|
|
45
|
-
*/
|
|
46
|
-
setHasSelection(value: boolean): void;
|
|
47
|
-
/**
|
|
48
|
-
* Update outline options
|
|
49
|
-
*/
|
|
50
|
-
setOptions(options: Partial<StencilSelectionOutlineOptions>): void;
|
|
51
|
-
render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, _deltaTime?: number, _maskActive?: boolean): void;
|
|
52
|
-
setSize(width: number, height: number): void;
|
|
53
|
-
dispose(): void;
|
|
54
|
-
}
|