three-virtual-geometry 0.1.0 → 0.1.2
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/AGENTS.md +14 -0
- package/dist/core/import/fromObject3D.d.ts +3 -3
- package/dist/core/io/cache.d.ts +1 -1
- package/dist/core/io/serialize.d.ts +1 -1
- package/dist/core/runtime/GeometryPool.d.ts +2 -2
- package/dist/core/runtime/OcclusionCulling.d.ts +1 -1
- package/dist/core/runtime/VirtualGeometry.d.ts +6 -6
- package/dist/core/runtime/VirtualMesh.d.ts +4 -4
- package/dist/core/runtime/cut.d.ts +1 -1
- package/dist/index.d.ts +20 -20
- package/dist/index.js.map +1 -1
- package/dist/source.d.ts +1 -1
- package/dist/three-virtual-geometry.all.min.js +1 -1
- package/dist/three-virtual-geometry.min.js +2 -2
- package/dist/three-virtual-geometry.min.js.map +2 -2
- package/package.json +5 -3
package/AGENTS.md
CHANGED
|
@@ -25,6 +25,20 @@ npm run bench # uncapped FPS of every demo scene in Chrome (Playwright) -
|
|
|
25
25
|
GPU code can only be checked in a WebGPU browser. After runtime changes, load the demo scenes and check the console
|
|
26
26
|
for WebGPU validation errors and the HUD for `overflow`.
|
|
27
27
|
|
|
28
|
+
## Releasing
|
|
29
|
+
|
|
30
|
+
Releases are published by GitHub Actions (`.github/workflows/release.yml`) with npm Trusted Publishing: no npm
|
|
31
|
+
token exists anywhere, and each version gets a provenance attestation on npm.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm version patch # or minor / major: bumps package.json, commits and tags vX.Y.Z
|
|
35
|
+
git push --follow-tags # the tag starts the Release workflow
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The workflow checks that the tag matches `package.json`, runs typecheck, tests, build and `check:types`, publishes
|
|
39
|
+
to npm, and creates the GitHub release with generated notes. jsDelivr and unpkg pick up the new version from npm.
|
|
40
|
+
Don't publish from a laptop.
|
|
41
|
+
|
|
28
42
|
## Layout
|
|
29
43
|
|
|
30
44
|
| Path | Role |
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* is built once. Skinned and morphing meshes, points, lines and sprites are left alone and keep rendering.
|
|
7
7
|
*/
|
|
8
8
|
import * as THREE from 'three/webgpu';
|
|
9
|
-
import { type VirtualMeshBuildOptions, type VirtualMeshData, type VirtualMeshSource } from '../preprocess/buildVirtualMesh';
|
|
10
|
-
import type { VirtualGeometry } from '../runtime/VirtualGeometry';
|
|
11
|
-
import type { VirtualMesh, VirtualMeshOptions } from '../runtime/VirtualMesh';
|
|
9
|
+
import { type VirtualMeshBuildOptions, type VirtualMeshData, type VirtualMeshSource } from '../preprocess/buildVirtualMesh.js';
|
|
10
|
+
import type { VirtualGeometry } from '../runtime/VirtualGeometry.js';
|
|
11
|
+
import type { VirtualMesh, VirtualMeshOptions } from '../runtime/VirtualMesh.js';
|
|
12
12
|
/** Builds one DAG. Same signature as `buildVirtualMesh`, so a caching builder drops in here or via `options.builder`. */
|
|
13
13
|
export type VirtualGeometryBuilder = (source: VirtualMeshSource, options?: VirtualMeshBuildOptions) => Promise<VirtualMeshData>;
|
|
14
14
|
export interface VirtualGeometryImportOptions {
|
package/dist/core/io/cache.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* source arrays and build options. The first load builds and stores the encoded result; later loads decode
|
|
4
4
|
* it. Any cache problem (no IndexedDB, private mode, quota, corrupt entry) falls back to building.
|
|
5
5
|
*/
|
|
6
|
-
import { type VirtualMeshBuildOptions, type VirtualMeshData, type VirtualMeshSource } from '../preprocess/buildVirtualMesh';
|
|
6
|
+
import { type VirtualMeshBuildOptions, type VirtualMeshData, type VirtualMeshSource } from '../preprocess/buildVirtualMesh.js';
|
|
7
7
|
/**
|
|
8
8
|
* Part of every cache key. Bump it whenever `buildVirtualMesh` produces different output for the same input
|
|
9
9
|
* (algorithm or default changes), so stale cached builds are never returned.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh';
|
|
1
|
+
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh.js';
|
|
2
2
|
/** Bumped whenever the container layout or an encoding changes; older readers reject newer files. */
|
|
3
3
|
export declare const VG_FORMAT_VERSION = 1;
|
|
4
4
|
export interface VirtualMeshEncodeOptions {
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
* Based on nanite-webgpu (MIT, Marcin Matuszczyk): cullMeshletsPass + rasterizeHwPass.
|
|
29
29
|
*/
|
|
30
30
|
import * as THREE from 'three/webgpu';
|
|
31
|
-
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh';
|
|
32
|
-
import type { VirtualGeometry } from './VirtualGeometry';
|
|
31
|
+
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh.js';
|
|
32
|
+
import type { VirtualGeometry } from './VirtualGeometry.js';
|
|
33
33
|
type Node = any;
|
|
34
34
|
/** World-space normal of the current vertex, usable in material color/roughness nodes. */
|
|
35
35
|
export declare const vgWorldNormal: THREE.PropertyNode<"vec3">;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* sized for `maxSize`, so nothing is reallocated on resize.
|
|
25
25
|
*/
|
|
26
26
|
import * as THREE from 'three/webgpu';
|
|
27
|
-
import type { VirtualMesh } from './VirtualMesh';
|
|
27
|
+
import type { VirtualMesh } from './VirtualMesh.js';
|
|
28
28
|
type Node = any;
|
|
29
29
|
export declare class OcclusionCulling {
|
|
30
30
|
/** Lever: set false to turn occlusion culling off (no occluder pass, no HZB, nothing culled by it). */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as THREE from 'three/webgpu';
|
|
2
|
-
import type { VirtualMesh, VirtualMeshInstances, VirtualMeshOptions } from './VirtualMesh';
|
|
3
|
-
import { OcclusionCulling } from './OcclusionCulling';
|
|
4
|
-
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh';
|
|
5
|
-
import { GeometryPool } from './GeometryPool';
|
|
6
|
-
import { type VirtualGeometryImport, type VirtualGeometryImportOptions } from '../import/fromObject3D';
|
|
7
|
-
export { VG_DEBUG_MODES } from '../constants';
|
|
2
|
+
import type { VirtualMesh, VirtualMeshInstances, VirtualMeshOptions } from './VirtualMesh.js';
|
|
3
|
+
import { OcclusionCulling } from './OcclusionCulling.js';
|
|
4
|
+
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh.js';
|
|
5
|
+
import { GeometryPool } from './GeometryPool.js';
|
|
6
|
+
import { type VirtualGeometryImport, type VirtualGeometryImportOptions } from '../import/fromObject3D.js';
|
|
7
|
+
export { VG_DEBUG_MODES } from '../constants.js';
|
|
8
8
|
export interface VirtualGeometryStats {
|
|
9
9
|
drawnMeshlets: number;
|
|
10
10
|
drawnTriangles: number;
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* the camera cut and the shadow cut, which draw this mesh's region of the pool's index buffers.
|
|
7
7
|
*/
|
|
8
8
|
import * as THREE from 'three/webgpu';
|
|
9
|
-
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh';
|
|
10
|
-
import type { VirtualGeometry } from './VirtualGeometry';
|
|
11
|
-
import { type GeometryPool, type PoolEntry } from './GeometryPool';
|
|
12
|
-
export { vgWorldNormal, encodeOctNormal, packVertices, packUvs } from './GeometryPool';
|
|
9
|
+
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh.js';
|
|
10
|
+
import type { VirtualGeometry } from './VirtualGeometry.js';
|
|
11
|
+
import { type GeometryPool, type PoolEntry } from './GeometryPool.js';
|
|
12
|
+
export { vgWorldNormal, encodeOctNormal, packVertices, packUvs } from './GeometryPool.js';
|
|
13
13
|
export interface VirtualMeshInstances {
|
|
14
14
|
/** 16 floats (column-major Matrix4) per instance. */
|
|
15
15
|
matrices: Float32Array;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh';
|
|
1
|
+
import type { VirtualMeshData } from '../preprocess/buildVirtualMesh.js';
|
|
2
2
|
/** Camera parameters the LOD test needs. Same values the GPU pass uses. */
|
|
3
3
|
export interface CutView {
|
|
4
4
|
/** Column-major world-to-view matrix (camera.matrixWorldInverse.elements). */
|
package/dist/index.d.ts
CHANGED
|
@@ -13,23 +13,23 @@
|
|
|
13
13
|
* Lower level: `buildVirtualMeshCached(fromBufferGeometry(geometry))` once per mesh, then
|
|
14
14
|
* `vg.createMesh(data, material, { matrices })` (16 floats per instance) and add it to a scene.
|
|
15
15
|
*/
|
|
16
|
-
export { buildVirtualMesh } from './core/preprocess/buildVirtualMesh';
|
|
17
|
-
export type { VirtualMeshBuildOptions, VirtualMeshData, VirtualMeshSource } from './core/preprocess/buildVirtualMesh';
|
|
18
|
-
export { partitionMeshlets } from './core/preprocess/partition';
|
|
19
|
-
export { buildVirtualMeshCached, clearVirtualMeshCache, virtualMeshCacheKey, VG_BUILD_VERSION } from './core/io/cache';
|
|
20
|
-
export type { VirtualGeometryCacheOptions, VirtualGeometryCachedBuildOptions } from './core/io/cache';
|
|
21
|
-
export { decodeVirtualMesh, encodeVirtualMesh, loadVirtualMesh, VirtualMeshFormatError, VG_FORMAT_VERSION } from './core/io/serialize';
|
|
22
|
-
export type { VirtualMeshEncodeOptions } from './core/io/serialize';
|
|
23
|
-
export { instanceGuaranteedRange, instanceMeshletRange, selectCut, verifyCutCoverage } from './core/runtime/cut';
|
|
24
|
-
export type { CutView } from './core/runtime/cut';
|
|
25
|
-
export { VirtualMesh, vgWorldNormal } from './core/runtime/VirtualMesh';
|
|
26
|
-
export { vgUv, vgTexture, vgNormalMap, bindVirtualGeometryTextures } from './core/runtime/vgMaterial';
|
|
27
|
-
export { toNodeMaterial, canConvertToNodeMaterial } from './core/import/toNodeMaterial';
|
|
28
|
-
export { virtualMeshesFromObject3D, collectVirtualGeometryGroups, VirtualGeometryImport } from './core/import/fromObject3D';
|
|
29
|
-
export type { VirtualGeometryImportOptions, VirtualGeometryImportGroup, VirtualGeometryBuilder } from './core/import/fromObject3D';
|
|
30
|
-
export type { VirtualMeshInstances, VirtualMeshOptions } from './core/runtime/VirtualMesh';
|
|
31
|
-
export { VirtualGeometry } from './core/runtime/VirtualGeometry';
|
|
32
|
-
export type { VirtualGeometryStats, VirtualGeometryOptions } from './core/runtime/VirtualGeometry';
|
|
33
|
-
export { VG_DEBUG_MODES, MAX_MESHLET_TRIANGLES, MAX_MESHLET_VERTICES } from './core/constants';
|
|
34
|
-
export { fromBufferGeometry, mergeSources } from './source';
|
|
35
|
-
export type { FromGeometryOptions } from './source';
|
|
16
|
+
export { buildVirtualMesh } from './core/preprocess/buildVirtualMesh.js';
|
|
17
|
+
export type { VirtualMeshBuildOptions, VirtualMeshData, VirtualMeshSource } from './core/preprocess/buildVirtualMesh.js';
|
|
18
|
+
export { partitionMeshlets } from './core/preprocess/partition.js';
|
|
19
|
+
export { buildVirtualMeshCached, clearVirtualMeshCache, virtualMeshCacheKey, VG_BUILD_VERSION } from './core/io/cache.js';
|
|
20
|
+
export type { VirtualGeometryCacheOptions, VirtualGeometryCachedBuildOptions } from './core/io/cache.js';
|
|
21
|
+
export { decodeVirtualMesh, encodeVirtualMesh, loadVirtualMesh, VirtualMeshFormatError, VG_FORMAT_VERSION } from './core/io/serialize.js';
|
|
22
|
+
export type { VirtualMeshEncodeOptions } from './core/io/serialize.js';
|
|
23
|
+
export { instanceGuaranteedRange, instanceMeshletRange, selectCut, verifyCutCoverage } from './core/runtime/cut.js';
|
|
24
|
+
export type { CutView } from './core/runtime/cut.js';
|
|
25
|
+
export { VirtualMesh, vgWorldNormal } from './core/runtime/VirtualMesh.js';
|
|
26
|
+
export { vgUv, vgTexture, vgNormalMap, bindVirtualGeometryTextures } from './core/runtime/vgMaterial.js';
|
|
27
|
+
export { toNodeMaterial, canConvertToNodeMaterial } from './core/import/toNodeMaterial.js';
|
|
28
|
+
export { virtualMeshesFromObject3D, collectVirtualGeometryGroups, VirtualGeometryImport } from './core/import/fromObject3D.js';
|
|
29
|
+
export type { VirtualGeometryImportOptions, VirtualGeometryImportGroup, VirtualGeometryBuilder } from './core/import/fromObject3D.js';
|
|
30
|
+
export type { VirtualMeshInstances, VirtualMeshOptions } from './core/runtime/VirtualMesh.js';
|
|
31
|
+
export { VirtualGeometry } from './core/runtime/VirtualGeometry.js';
|
|
32
|
+
export type { VirtualGeometryStats, VirtualGeometryOptions } from './core/runtime/VirtualGeometry.js';
|
|
33
|
+
export { VG_DEBUG_MODES, MAX_MESHLET_TRIANGLES, MAX_MESHLET_VERTICES } from './core/constants.js';
|
|
34
|
+
export { fromBufferGeometry, mergeSources } from './source.js';
|
|
35
|
+
export type { FromGeometryOptions } from './source.js';
|