three-virtual-geometry 0.0.0-stage → 0.1.1

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.
@@ -0,0 +1,34 @@
1
+ import * as THREE from 'three/webgpu';
2
+ import type { VirtualMeshSource } from './core/preprocess/buildVirtualMesh.js';
3
+ export interface FromGeometryOptions {
4
+ /**
5
+ * Keep the `uv` attribute. Vertices are then welded by position and UV, so UV seams stay separate vertices
6
+ * (the simplifier treats them as seams, not borders). Default: true when the geometry has a `uv` attribute.
7
+ */
8
+ uvs?: boolean;
9
+ /** Keep the `color` attribute as per-vertex colors (multiplied with the material color). Default: false. */
10
+ colors?: boolean;
11
+ /**
12
+ * 'compute' (default): smooth normals over the position-welded mesh, ignoring the `normal` attribute.
13
+ * 'keep': use the geometry's normals; vertices with different normals stay separate, so hard edges stay hard.
14
+ */
15
+ normals?: 'compute' | 'keep';
16
+ /** Only this range of the index buffer (or of the vertices, for non-indexed geometry), e.g. one of `geometry.groups`. */
17
+ range?: {
18
+ start: number;
19
+ count: number;
20
+ };
21
+ }
22
+ /**
23
+ * Weld vertices and produce a `VirtualMeshSource`. By default vertices are welded by position (and UV when the
24
+ * geometry has UVs) and get smooth normals, so meshlets share edges. See `FromGeometryOptions`.
25
+ */
26
+ export declare function fromBufferGeometry(geometry: THREE.BufferGeometry, options?: FromGeometryOptions): VirtualMeshSource;
27
+ /**
28
+ * Concatenate several already-welded meshes into one source mesh with per-vertex colors.
29
+ * Each part uses its own `colors` if present, otherwise the given flat `color`.
30
+ */
31
+ export declare function mergeSources(parts: {
32
+ mesh: VirtualMeshSource;
33
+ color?: THREE.ColorRepresentation;
34
+ }[]): VirtualMeshSource;