@hello-terrain/three 0.0.0-alpha.5 → 0.0.0-alpha.7

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/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { BufferGeometry } from 'three';
2
2
  import * as three_webgpu from 'three/webgpu';
3
- import { InstancedMesh, NodeMaterial, Node, WebGPURenderer, StorageBufferAttribute, StorageBufferNode, UniformNode, Vector3, Vector3Like, ConstNode } from 'three/webgpu';
3
+ import { InstancedMesh, NodeMaterial, Node, WebGPURenderer, StorageArrayTexture, StorageTexture, StorageBufferAttribute, StorageBufferNode, UniformNode, Vector3, Vector3Like, ConstNode } from 'three/webgpu';
4
4
  import * as three_src_nodes_TSL_js from 'three/src/nodes/TSL.js';
5
5
  import { ShaderCallNodeInternal } from 'three/src/nodes/TSL.js';
6
6
  import * as _hello_terrain_work from '@hello-terrain/work';
7
- import { TaskRef } from '@hello-terrain/work';
7
+ import { TaskRef, Graph } from '@hello-terrain/work';
8
8
  import Node$1 from 'three/src/nodes/core/Node.js';
9
9
  import * as three_tsl from 'three/tsl';
10
10
 
@@ -34,17 +34,19 @@ declare class TerrainGeometry extends BufferGeometry {
34
34
  * | / | \ | / | \ |
35
35
  * o---o---o---o---o
36
36
  *
37
- * INNER GRID (consistent diagonal, no rotational symmetry):
38
- * o---o---o
39
- * | \ | \ |
40
- * o---o---o
41
- * | \ | \ |
42
- * o---o---o
37
+ * INNER GRID (alternating diagonals checkerboard pattern):
38
+ * o---o---o---o---o
39
+ * | \ | / | \ | / |
40
+ * o---o---o---o---o
41
+ * | / | \ | / | \ |
42
+ * o---o---o---o---o
43
+ * | \ | / | \ | / |
44
+ * o---o---o---o---o
43
45
  *
44
46
  * Where o = vertex
45
47
  * Each square cell is split into 2 triangles.
46
48
  * - Skirt cells (outer ring): diagonal flip based on quadrant for corner correctness
47
- * - Inner cells: consistent diagonal direction (all triangles "point" the same way)
49
+ * - Inner cells: alternating diagonal via (x+y)%2 to reduce interpolation artifacts
48
50
  *
49
51
  * Vertex layout (for innerSegments = 2):
50
52
  *
@@ -112,7 +114,7 @@ declare class TerrainMesh extends InstancedMesh {
112
114
  type ComputeStageCallback = (nodeIndex: Node, globalVertexIndex: Node, uv: Node, localCoordinates: Node, texelSize: Node) => void;
113
115
  type ComputePipeline = ComputeStageCallback[];
114
116
 
115
- /** Default compile task — uses normalFieldStageTask as the leaf. */
117
+ /** Default compile task — uses terrainFieldStageTask as the leaf. */
116
118
  declare const compileComputeTask: _hello_terrain_work.Task<{
117
119
  execute: (renderer: WebGPURenderer, instanceCount: number) => void;
118
120
  }, string, unknown>;
@@ -388,6 +390,36 @@ type CubeSphereSurfaceConfig = {
388
390
  */
389
391
  declare function createCubeSphereSurface(_cfg: CubeSphereSurfaceConfig): Surface;
390
392
 
393
+ type TerrainFieldStorageBackendType = "array-texture" | "atlas" | "texture-3d";
394
+ type TerrainFieldStorageFormat = "rgba16float" | "rgba32float";
395
+ type TerrainFieldStorageOptions = {
396
+ backend?: TerrainFieldStorageBackendType;
397
+ filter?: "nearest" | "linear";
398
+ format?: TerrainFieldStorageFormat;
399
+ };
400
+ interface TerrainFieldStorage {
401
+ readonly backendType: TerrainFieldStorageBackendType;
402
+ readonly edgeVertexCount: number;
403
+ readonly tileCount: number;
404
+ readonly texture: StorageArrayTexture | StorageTexture;
405
+ uv(ix: Node, iy: Node, tileIndex: Node): Node;
406
+ texel(ix: Node, iy: Node, tileIndex: Node): Node;
407
+ resize(width: number, height: number, tileCount: number): void;
408
+ }
409
+ declare function ArrayTextureBackend(edgeVertexCount: number, tileCount: number, options: Required<Pick<TerrainFieldStorageOptions, "format" | "filter">>): TerrainFieldStorage;
410
+ declare function AtlasBackend(edgeVertexCount: number, tileCount: number, options: Required<Pick<TerrainFieldStorageOptions, "format" | "filter">>): TerrainFieldStorage;
411
+ /**
412
+ * Placeholder backend for future true 3D storage-texture support in Three.js.
413
+ * We keep it present to preserve the backend API shape.
414
+ */
415
+ declare function Texture3DBackend(edgeVertexCount: number, tileCount: number, options: Required<Pick<TerrainFieldStorageOptions, "format" | "filter">>): TerrainFieldStorage;
416
+ declare function createTerrainFieldStorage(edgeVertexCount: number, tileCount: number, renderer?: WebGPURenderer, options?: TerrainFieldStorageOptions): TerrainFieldStorage;
417
+ declare function storeTerrainField(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node, value: Node): Node;
418
+ declare function loadTerrainField(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node): Node;
419
+ declare function loadTerrainFieldElevation(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node): Node;
420
+ declare function loadTerrainFieldNormal(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node): Node;
421
+ declare function packTerrainFieldSample(height: Node, normalXZ: Node, extra?: Node): Node;
422
+
391
423
  interface TerrainUniformsParams {
392
424
  rootSize: number;
393
425
  rootOrigin: Vector3Like;
@@ -429,11 +461,6 @@ interface ElevationFieldContext {
429
461
  attribute: StorageBufferAttribute;
430
462
  node: StorageBufferNode;
431
463
  }
432
- interface NormalFieldContext {
433
- data: Uint32Array<ArrayBuffer>;
434
- attribute: StorageBufferAttribute;
435
- node: StorageBufferNode;
436
- }
437
464
  /** Task refs for the standard terrain pipeline. */
438
465
  interface TerrainTasks {
439
466
  instanceId: TaskRef<string>;
@@ -447,14 +474,17 @@ interface TerrainTasks {
447
474
  positionNode: TaskRef<ShaderCallNodeInternal>;
448
475
  createElevationFieldContext: TaskRef<ElevationFieldContext>;
449
476
  createTileNodes: TaskRef<ReturnType<typeof createTileCompute>>;
450
- createNormalFieldContext: TaskRef<NormalFieldContext>;
477
+ createTerrainFieldTexture: TaskRef<TerrainFieldStorage>;
451
478
  elevationFieldStage: TaskRef<ComputePipeline>;
452
- normalFieldStage: TaskRef<ComputePipeline>;
479
+ terrainFieldStage: TaskRef<ComputePipeline>;
453
480
  compileCompute: TaskRef<{
454
481
  execute: (renderer: WebGPURenderer, instanceCount: number) => void;
455
482
  }>;
456
483
  executeCompute: TaskRef<void | (() => void)>;
457
484
  }
485
+ type TerrainGraph = Graph<string, {
486
+ renderer: WebGPURenderer;
487
+ }>;
458
488
 
459
489
  declare const createElevationFieldContextTask: _hello_terrain_work.Task<{
460
490
  data: Float32Array<ArrayBuffer>;
@@ -477,11 +507,9 @@ declare const elevationFieldStageTask: _hello_terrain_work.Task<ComputePipeline,
477
507
  /** Generates a unique instance ID per graph (cached once). */
478
508
  declare const instanceIdTask: _hello_terrain_work.Task<`${string}-${string}-${string}-${string}-${string}`, string, unknown>;
479
509
 
480
- declare const createNormalFieldContextTask: _hello_terrain_work.Task<{
481
- data: Uint32Array<ArrayBuffer>;
482
- attribute: StorageBufferAttribute;
483
- node: three_webgpu.StorageBufferNode;
484
- }, string, unknown>;
510
+ declare const createTerrainFieldTextureTask: _hello_terrain_work.Task<any, string, {
511
+ renderer: WebGPURenderer;
512
+ }>;
485
513
  /**
486
514
  * Normal field compute stage — reads height neighbors from the elevation field
487
515
  * buffer, computes surface normals via central differences, packs XZ
@@ -490,7 +518,7 @@ declare const createNormalFieldContextTask: _hello_terrain_work.Task<{
490
518
  *
491
519
  * Accumulates the upstream elevation pipeline via `get(elevationFieldStageTask)`.
492
520
  */
493
- declare const normalFieldStageTask: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
521
+ declare const terrainFieldStageTask: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
494
522
 
495
523
  interface ElevationParams {
496
524
  worldPosition: Node$1;
@@ -514,7 +542,7 @@ declare const origin: _hello_terrain_work.ParamRef<{
514
542
  }>;
515
543
  /**
516
544
  * Number of segments per inner tile edge.
517
- * 13 is the max tiles we can support for 256 workgroups (13 + 3 === 16.. 16x16)
545
+ * Effective edge vertex count is `innerTileSegments + 3`.
518
546
  */
519
547
  declare const innerTileSegments: _hello_terrain_work.ParamRef<number>;
520
548
  /** Skirt scale factor. */
@@ -536,11 +564,10 @@ declare const elevationFn: _hello_terrain_work.ParamRef<ElevationCallback>;
536
564
  * Builds the TSL position node for the terrain shader.
537
565
  *
538
566
  * Depends on leafStorageTask (buffer objects), createUniformsTask
539
- * (uniform nodes), createElevationFieldContextTask (elevation field storage),
540
- * and createNormalFieldContextTask (normal field storage).
567
+ * (uniform nodes), and createTerrainFieldTextureTask (combined terrain field storage).
541
568
  *
542
- * The position node also reads normals from the normal field buffer
543
- * per-vertex (using vertexIndex) and assigns them to the vNormal
569
+ * The position node reads packed terrain samples (height + normal.xz)
570
+ * per-vertex and assigns them to the vNormal
544
571
  * varying for use in the fragment shader.
545
572
  *
546
573
  * These only change when their GPU resources are recreated
@@ -589,9 +616,7 @@ declare const createUniformsTask: _hello_terrain_work.Task<TerrainUniformsContex
589
616
  */
590
617
  declare const updateUniformsTask: _hello_terrain_work.Task<TerrainUniformsContext, string, unknown>;
591
618
 
592
- declare function terrainGraph(): _hello_terrain_work.Graph<string, {
593
- renderer: WebGPURenderer;
594
- }>;
619
+ declare function terrainGraph(): TerrainGraph;
595
620
  /** All terrain task refs for direct access. */
596
621
  declare const terrainTasks: {
597
622
  readonly instanceId: _hello_terrain_work.Task<`${string}-${string}-${string}-${string}-${string}`, string, unknown>;
@@ -623,13 +648,11 @@ declare const terrainTasks: {
623
648
  rootUVCompute: three_src_nodes_TSL_js.ShaderNodeFn<[number | three_webgpu.Node, number | three_webgpu.Node, number | three_webgpu.Node]>;
624
649
  tileVertexWorldPositionCompute: three_src_nodes_TSL_js.ShaderNodeFn<[number | three_webgpu.Node, number | three_webgpu.Node, number | three_webgpu.Node]>;
625
650
  }, string, unknown>;
626
- readonly createNormalFieldContext: _hello_terrain_work.Task<{
627
- data: Uint32Array<ArrayBuffer>;
628
- attribute: three_webgpu.StorageBufferAttribute;
629
- node: three_webgpu.StorageBufferNode;
630
- }, string, unknown>;
651
+ readonly createTerrainFieldTexture: _hello_terrain_work.Task<any, string, {
652
+ renderer: WebGPURenderer;
653
+ }>;
631
654
  readonly elevationFieldStage: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
632
- readonly normalFieldStage: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
655
+ readonly terrainFieldStage: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
633
656
  readonly compileCompute: _hello_terrain_work.Task<{
634
657
  execute: (renderer: WebGPURenderer, instanceCount: number) => void;
635
658
  }, string, unknown>;
@@ -638,6 +661,13 @@ declare const terrainTasks: {
638
661
  }>;
639
662
  };
640
663
 
664
+ type ComputeDeviceLimits = {
665
+ maxWorkgroupSizeX: number;
666
+ maxWorkgroupSizeY: number;
667
+ maxWorkgroupInvocations: number;
668
+ };
669
+ declare function getDeviceComputeLimits(renderer: WebGPURenderer): ComputeDeviceLimits;
670
+
641
671
  /**
642
672
  * Maps a value or node from texture space [0, 1] to vector space [-1, 1].
643
673
  *
@@ -710,5 +740,5 @@ declare const voronoiCells: three_src_nodes_TSL_js.ShaderNodeFn<[three_tsl.Proxi
710
740
  uv: Node;
711
741
  }>]>;
712
742
 
713
- export { Dir, TerrainGeometry, TerrainMesh, U32_EMPTY, allocLeafSet, allocSeamTable, beginUpdate, blendAngleCorrectedNormals, buildLeafIndex, buildSeams2to1, compileComputeTask, createComputePipelineTasks, createCubeSphereSurface, createElevationFieldContextTask, createFlatSurface, createInfiniteFlatSurface, createNormalFieldContextTask, createSpatialIndex, createState, createTerrainUniforms, createUniformsTask, deriveNormalZ, elevationFieldStageTask, elevationFn, elevationScale, executeComputeTask, innerTileSegments, instanceIdTask, isSkirtUV, isSkirtVertex, leafGpuBufferTask, leafStorageTask, maxLevel, maxNodes, normalFieldStageTask, origin, positionNodeTask, quadtreeConfigTask, quadtreeUpdate, quadtreeUpdateTask, resetLeafSet, resetSeamTable, rootSize, skirtScale, surface, surfaceTask, terrainGraph, terrainTasks, textureSpaceToVectorSpace, tileNodesTask, update, updateUniformsTask, vElevation, vGlobalVertexIndex, vectorSpaceToTextureSpace, voronoiCells };
714
- export type { ComputePipeline, ComputeStageCallback, CubeSphereSurfaceConfig, ElevationCallback, ElevationFieldContext, ElevationParams, FlatSurfaceConfig, InfiniteFlatSurfaceConfig, IntNodeInput, LeafGpuBufferState, LeafSet, LeafStorageState, LodMode, NormalFieldContext, QuadtreeConfig, QuadtreeConfigState, QuadtreeState, SeamTable, SpatialIndex, Surface, TerrainTasks, TerrainUniformsContext, TerrainUniformsParams, TileBounds, TileId, UpdateParams };
743
+ export { ArrayTextureBackend, AtlasBackend, Dir, TerrainGeometry, TerrainMesh, Texture3DBackend, U32_EMPTY, allocLeafSet, allocSeamTable, beginUpdate, blendAngleCorrectedNormals, buildLeafIndex, buildSeams2to1, compileComputeTask, createComputePipelineTasks, createCubeSphereSurface, createElevationFieldContextTask, createFlatSurface, createInfiniteFlatSurface, createSpatialIndex, createState, createTerrainFieldStorage, createTerrainFieldTextureTask, createTerrainUniforms, createUniformsTask, deriveNormalZ, elevationFieldStageTask, elevationFn, elevationScale, executeComputeTask, getDeviceComputeLimits, innerTileSegments, instanceIdTask, isSkirtUV, isSkirtVertex, leafGpuBufferTask, leafStorageTask, loadTerrainField, loadTerrainFieldElevation, loadTerrainFieldNormal, maxLevel, maxNodes, origin, packTerrainFieldSample, positionNodeTask, quadtreeConfigTask, quadtreeUpdate, quadtreeUpdateTask, resetLeafSet, resetSeamTable, rootSize, skirtScale, storeTerrainField, surface, surfaceTask, terrainFieldStageTask, terrainGraph, terrainTasks, textureSpaceToVectorSpace, tileNodesTask, update, updateUniformsTask, vElevation, vGlobalVertexIndex, vectorSpaceToTextureSpace, voronoiCells };
744
+ export type { ComputePipeline, ComputeStageCallback, CubeSphereSurfaceConfig, ElevationCallback, ElevationFieldContext, ElevationParams, FlatSurfaceConfig, InfiniteFlatSurfaceConfig, IntNodeInput, LeafGpuBufferState, LeafSet, LeafStorageState, LodMode, QuadtreeConfig, QuadtreeConfigState, QuadtreeState, SeamTable, SpatialIndex, Surface, TerrainFieldStorage, TerrainFieldStorageBackendType, TerrainFieldStorageFormat, TerrainFieldStorageOptions, TerrainGraph, TerrainTasks, TerrainUniformsContext, TerrainUniformsParams, TileBounds, TileId, UpdateParams };
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { BufferGeometry } from 'three';
2
2
  import * as three_webgpu from 'three/webgpu';
3
- import { InstancedMesh, NodeMaterial, Node, WebGPURenderer, StorageBufferAttribute, StorageBufferNode, UniformNode, Vector3, Vector3Like, ConstNode } from 'three/webgpu';
3
+ import { InstancedMesh, NodeMaterial, Node, WebGPURenderer, StorageArrayTexture, StorageTexture, StorageBufferAttribute, StorageBufferNode, UniformNode, Vector3, Vector3Like, ConstNode } from 'three/webgpu';
4
4
  import * as three_src_nodes_TSL_js from 'three/src/nodes/TSL.js';
5
5
  import { ShaderCallNodeInternal } from 'three/src/nodes/TSL.js';
6
6
  import * as _hello_terrain_work from '@hello-terrain/work';
7
- import { TaskRef } from '@hello-terrain/work';
7
+ import { TaskRef, Graph } from '@hello-terrain/work';
8
8
  import Node$1 from 'three/src/nodes/core/Node.js';
9
9
  import * as three_tsl from 'three/tsl';
10
10
 
@@ -34,17 +34,19 @@ declare class TerrainGeometry extends BufferGeometry {
34
34
  * | / | \ | / | \ |
35
35
  * o---o---o---o---o
36
36
  *
37
- * INNER GRID (consistent diagonal, no rotational symmetry):
38
- * o---o---o
39
- * | \ | \ |
40
- * o---o---o
41
- * | \ | \ |
42
- * o---o---o
37
+ * INNER GRID (alternating diagonals checkerboard pattern):
38
+ * o---o---o---o---o
39
+ * | \ | / | \ | / |
40
+ * o---o---o---o---o
41
+ * | / | \ | / | \ |
42
+ * o---o---o---o---o
43
+ * | \ | / | \ | / |
44
+ * o---o---o---o---o
43
45
  *
44
46
  * Where o = vertex
45
47
  * Each square cell is split into 2 triangles.
46
48
  * - Skirt cells (outer ring): diagonal flip based on quadrant for corner correctness
47
- * - Inner cells: consistent diagonal direction (all triangles "point" the same way)
49
+ * - Inner cells: alternating diagonal via (x+y)%2 to reduce interpolation artifacts
48
50
  *
49
51
  * Vertex layout (for innerSegments = 2):
50
52
  *
@@ -112,7 +114,7 @@ declare class TerrainMesh extends InstancedMesh {
112
114
  type ComputeStageCallback = (nodeIndex: Node, globalVertexIndex: Node, uv: Node, localCoordinates: Node, texelSize: Node) => void;
113
115
  type ComputePipeline = ComputeStageCallback[];
114
116
 
115
- /** Default compile task — uses normalFieldStageTask as the leaf. */
117
+ /** Default compile task — uses terrainFieldStageTask as the leaf. */
116
118
  declare const compileComputeTask: _hello_terrain_work.Task<{
117
119
  execute: (renderer: WebGPURenderer, instanceCount: number) => void;
118
120
  }, string, unknown>;
@@ -388,6 +390,36 @@ type CubeSphereSurfaceConfig = {
388
390
  */
389
391
  declare function createCubeSphereSurface(_cfg: CubeSphereSurfaceConfig): Surface;
390
392
 
393
+ type TerrainFieldStorageBackendType = "array-texture" | "atlas" | "texture-3d";
394
+ type TerrainFieldStorageFormat = "rgba16float" | "rgba32float";
395
+ type TerrainFieldStorageOptions = {
396
+ backend?: TerrainFieldStorageBackendType;
397
+ filter?: "nearest" | "linear";
398
+ format?: TerrainFieldStorageFormat;
399
+ };
400
+ interface TerrainFieldStorage {
401
+ readonly backendType: TerrainFieldStorageBackendType;
402
+ readonly edgeVertexCount: number;
403
+ readonly tileCount: number;
404
+ readonly texture: StorageArrayTexture | StorageTexture;
405
+ uv(ix: Node, iy: Node, tileIndex: Node): Node;
406
+ texel(ix: Node, iy: Node, tileIndex: Node): Node;
407
+ resize(width: number, height: number, tileCount: number): void;
408
+ }
409
+ declare function ArrayTextureBackend(edgeVertexCount: number, tileCount: number, options: Required<Pick<TerrainFieldStorageOptions, "format" | "filter">>): TerrainFieldStorage;
410
+ declare function AtlasBackend(edgeVertexCount: number, tileCount: number, options: Required<Pick<TerrainFieldStorageOptions, "format" | "filter">>): TerrainFieldStorage;
411
+ /**
412
+ * Placeholder backend for future true 3D storage-texture support in Three.js.
413
+ * We keep it present to preserve the backend API shape.
414
+ */
415
+ declare function Texture3DBackend(edgeVertexCount: number, tileCount: number, options: Required<Pick<TerrainFieldStorageOptions, "format" | "filter">>): TerrainFieldStorage;
416
+ declare function createTerrainFieldStorage(edgeVertexCount: number, tileCount: number, renderer?: WebGPURenderer, options?: TerrainFieldStorageOptions): TerrainFieldStorage;
417
+ declare function storeTerrainField(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node, value: Node): Node;
418
+ declare function loadTerrainField(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node): Node;
419
+ declare function loadTerrainFieldElevation(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node): Node;
420
+ declare function loadTerrainFieldNormal(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node): Node;
421
+ declare function packTerrainFieldSample(height: Node, normalXZ: Node, extra?: Node): Node;
422
+
391
423
  interface TerrainUniformsParams {
392
424
  rootSize: number;
393
425
  rootOrigin: Vector3Like;
@@ -429,11 +461,6 @@ interface ElevationFieldContext {
429
461
  attribute: StorageBufferAttribute;
430
462
  node: StorageBufferNode;
431
463
  }
432
- interface NormalFieldContext {
433
- data: Uint32Array<ArrayBuffer>;
434
- attribute: StorageBufferAttribute;
435
- node: StorageBufferNode;
436
- }
437
464
  /** Task refs for the standard terrain pipeline. */
438
465
  interface TerrainTasks {
439
466
  instanceId: TaskRef<string>;
@@ -447,14 +474,17 @@ interface TerrainTasks {
447
474
  positionNode: TaskRef<ShaderCallNodeInternal>;
448
475
  createElevationFieldContext: TaskRef<ElevationFieldContext>;
449
476
  createTileNodes: TaskRef<ReturnType<typeof createTileCompute>>;
450
- createNormalFieldContext: TaskRef<NormalFieldContext>;
477
+ createTerrainFieldTexture: TaskRef<TerrainFieldStorage>;
451
478
  elevationFieldStage: TaskRef<ComputePipeline>;
452
- normalFieldStage: TaskRef<ComputePipeline>;
479
+ terrainFieldStage: TaskRef<ComputePipeline>;
453
480
  compileCompute: TaskRef<{
454
481
  execute: (renderer: WebGPURenderer, instanceCount: number) => void;
455
482
  }>;
456
483
  executeCompute: TaskRef<void | (() => void)>;
457
484
  }
485
+ type TerrainGraph = Graph<string, {
486
+ renderer: WebGPURenderer;
487
+ }>;
458
488
 
459
489
  declare const createElevationFieldContextTask: _hello_terrain_work.Task<{
460
490
  data: Float32Array<ArrayBuffer>;
@@ -477,11 +507,9 @@ declare const elevationFieldStageTask: _hello_terrain_work.Task<ComputePipeline,
477
507
  /** Generates a unique instance ID per graph (cached once). */
478
508
  declare const instanceIdTask: _hello_terrain_work.Task<`${string}-${string}-${string}-${string}-${string}`, string, unknown>;
479
509
 
480
- declare const createNormalFieldContextTask: _hello_terrain_work.Task<{
481
- data: Uint32Array<ArrayBuffer>;
482
- attribute: StorageBufferAttribute;
483
- node: three_webgpu.StorageBufferNode;
484
- }, string, unknown>;
510
+ declare const createTerrainFieldTextureTask: _hello_terrain_work.Task<any, string, {
511
+ renderer: WebGPURenderer;
512
+ }>;
485
513
  /**
486
514
  * Normal field compute stage — reads height neighbors from the elevation field
487
515
  * buffer, computes surface normals via central differences, packs XZ
@@ -490,7 +518,7 @@ declare const createNormalFieldContextTask: _hello_terrain_work.Task<{
490
518
  *
491
519
  * Accumulates the upstream elevation pipeline via `get(elevationFieldStageTask)`.
492
520
  */
493
- declare const normalFieldStageTask: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
521
+ declare const terrainFieldStageTask: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
494
522
 
495
523
  interface ElevationParams {
496
524
  worldPosition: Node$1;
@@ -514,7 +542,7 @@ declare const origin: _hello_terrain_work.ParamRef<{
514
542
  }>;
515
543
  /**
516
544
  * Number of segments per inner tile edge.
517
- * 13 is the max tiles we can support for 256 workgroups (13 + 3 === 16.. 16x16)
545
+ * Effective edge vertex count is `innerTileSegments + 3`.
518
546
  */
519
547
  declare const innerTileSegments: _hello_terrain_work.ParamRef<number>;
520
548
  /** Skirt scale factor. */
@@ -536,11 +564,10 @@ declare const elevationFn: _hello_terrain_work.ParamRef<ElevationCallback>;
536
564
  * Builds the TSL position node for the terrain shader.
537
565
  *
538
566
  * Depends on leafStorageTask (buffer objects), createUniformsTask
539
- * (uniform nodes), createElevationFieldContextTask (elevation field storage),
540
- * and createNormalFieldContextTask (normal field storage).
567
+ * (uniform nodes), and createTerrainFieldTextureTask (combined terrain field storage).
541
568
  *
542
- * The position node also reads normals from the normal field buffer
543
- * per-vertex (using vertexIndex) and assigns them to the vNormal
569
+ * The position node reads packed terrain samples (height + normal.xz)
570
+ * per-vertex and assigns them to the vNormal
544
571
  * varying for use in the fragment shader.
545
572
  *
546
573
  * These only change when their GPU resources are recreated
@@ -589,9 +616,7 @@ declare const createUniformsTask: _hello_terrain_work.Task<TerrainUniformsContex
589
616
  */
590
617
  declare const updateUniformsTask: _hello_terrain_work.Task<TerrainUniformsContext, string, unknown>;
591
618
 
592
- declare function terrainGraph(): _hello_terrain_work.Graph<string, {
593
- renderer: WebGPURenderer;
594
- }>;
619
+ declare function terrainGraph(): TerrainGraph;
595
620
  /** All terrain task refs for direct access. */
596
621
  declare const terrainTasks: {
597
622
  readonly instanceId: _hello_terrain_work.Task<`${string}-${string}-${string}-${string}-${string}`, string, unknown>;
@@ -623,13 +648,11 @@ declare const terrainTasks: {
623
648
  rootUVCompute: three_src_nodes_TSL_js.ShaderNodeFn<[number | three_webgpu.Node, number | three_webgpu.Node, number | three_webgpu.Node]>;
624
649
  tileVertexWorldPositionCompute: three_src_nodes_TSL_js.ShaderNodeFn<[number | three_webgpu.Node, number | three_webgpu.Node, number | three_webgpu.Node]>;
625
650
  }, string, unknown>;
626
- readonly createNormalFieldContext: _hello_terrain_work.Task<{
627
- data: Uint32Array<ArrayBuffer>;
628
- attribute: three_webgpu.StorageBufferAttribute;
629
- node: three_webgpu.StorageBufferNode;
630
- }, string, unknown>;
651
+ readonly createTerrainFieldTexture: _hello_terrain_work.Task<any, string, {
652
+ renderer: WebGPURenderer;
653
+ }>;
631
654
  readonly elevationFieldStage: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
632
- readonly normalFieldStage: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
655
+ readonly terrainFieldStage: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
633
656
  readonly compileCompute: _hello_terrain_work.Task<{
634
657
  execute: (renderer: WebGPURenderer, instanceCount: number) => void;
635
658
  }, string, unknown>;
@@ -638,6 +661,13 @@ declare const terrainTasks: {
638
661
  }>;
639
662
  };
640
663
 
664
+ type ComputeDeviceLimits = {
665
+ maxWorkgroupSizeX: number;
666
+ maxWorkgroupSizeY: number;
667
+ maxWorkgroupInvocations: number;
668
+ };
669
+ declare function getDeviceComputeLimits(renderer: WebGPURenderer): ComputeDeviceLimits;
670
+
641
671
  /**
642
672
  * Maps a value or node from texture space [0, 1] to vector space [-1, 1].
643
673
  *
@@ -710,5 +740,5 @@ declare const voronoiCells: three_src_nodes_TSL_js.ShaderNodeFn<[three_tsl.Proxi
710
740
  uv: Node;
711
741
  }>]>;
712
742
 
713
- export { Dir, TerrainGeometry, TerrainMesh, U32_EMPTY, allocLeafSet, allocSeamTable, beginUpdate, blendAngleCorrectedNormals, buildLeafIndex, buildSeams2to1, compileComputeTask, createComputePipelineTasks, createCubeSphereSurface, createElevationFieldContextTask, createFlatSurface, createInfiniteFlatSurface, createNormalFieldContextTask, createSpatialIndex, createState, createTerrainUniforms, createUniformsTask, deriveNormalZ, elevationFieldStageTask, elevationFn, elevationScale, executeComputeTask, innerTileSegments, instanceIdTask, isSkirtUV, isSkirtVertex, leafGpuBufferTask, leafStorageTask, maxLevel, maxNodes, normalFieldStageTask, origin, positionNodeTask, quadtreeConfigTask, quadtreeUpdate, quadtreeUpdateTask, resetLeafSet, resetSeamTable, rootSize, skirtScale, surface, surfaceTask, terrainGraph, terrainTasks, textureSpaceToVectorSpace, tileNodesTask, update, updateUniformsTask, vElevation, vGlobalVertexIndex, vectorSpaceToTextureSpace, voronoiCells };
714
- export type { ComputePipeline, ComputeStageCallback, CubeSphereSurfaceConfig, ElevationCallback, ElevationFieldContext, ElevationParams, FlatSurfaceConfig, InfiniteFlatSurfaceConfig, IntNodeInput, LeafGpuBufferState, LeafSet, LeafStorageState, LodMode, NormalFieldContext, QuadtreeConfig, QuadtreeConfigState, QuadtreeState, SeamTable, SpatialIndex, Surface, TerrainTasks, TerrainUniformsContext, TerrainUniformsParams, TileBounds, TileId, UpdateParams };
743
+ export { ArrayTextureBackend, AtlasBackend, Dir, TerrainGeometry, TerrainMesh, Texture3DBackend, U32_EMPTY, allocLeafSet, allocSeamTable, beginUpdate, blendAngleCorrectedNormals, buildLeafIndex, buildSeams2to1, compileComputeTask, createComputePipelineTasks, createCubeSphereSurface, createElevationFieldContextTask, createFlatSurface, createInfiniteFlatSurface, createSpatialIndex, createState, createTerrainFieldStorage, createTerrainFieldTextureTask, createTerrainUniforms, createUniformsTask, deriveNormalZ, elevationFieldStageTask, elevationFn, elevationScale, executeComputeTask, getDeviceComputeLimits, innerTileSegments, instanceIdTask, isSkirtUV, isSkirtVertex, leafGpuBufferTask, leafStorageTask, loadTerrainField, loadTerrainFieldElevation, loadTerrainFieldNormal, maxLevel, maxNodes, origin, packTerrainFieldSample, positionNodeTask, quadtreeConfigTask, quadtreeUpdate, quadtreeUpdateTask, resetLeafSet, resetSeamTable, rootSize, skirtScale, storeTerrainField, surface, surfaceTask, terrainFieldStageTask, terrainGraph, terrainTasks, textureSpaceToVectorSpace, tileNodesTask, update, updateUniformsTask, vElevation, vGlobalVertexIndex, vectorSpaceToTextureSpace, voronoiCells };
744
+ export type { ComputePipeline, ComputeStageCallback, CubeSphereSurfaceConfig, ElevationCallback, ElevationFieldContext, ElevationParams, FlatSurfaceConfig, InfiniteFlatSurfaceConfig, IntNodeInput, LeafGpuBufferState, LeafSet, LeafStorageState, LodMode, QuadtreeConfig, QuadtreeConfigState, QuadtreeState, SeamTable, SpatialIndex, Surface, TerrainFieldStorage, TerrainFieldStorageBackendType, TerrainFieldStorageFormat, TerrainFieldStorageOptions, TerrainGraph, TerrainTasks, TerrainUniformsContext, TerrainUniformsParams, TileBounds, TileId, UpdateParams };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { BufferGeometry } from 'three';
2
2
  import * as three_webgpu from 'three/webgpu';
3
- import { InstancedMesh, NodeMaterial, Node, WebGPURenderer, StorageBufferAttribute, StorageBufferNode, UniformNode, Vector3, Vector3Like, ConstNode } from 'three/webgpu';
3
+ import { InstancedMesh, NodeMaterial, Node, WebGPURenderer, StorageArrayTexture, StorageTexture, StorageBufferAttribute, StorageBufferNode, UniformNode, Vector3, Vector3Like, ConstNode } from 'three/webgpu';
4
4
  import * as three_src_nodes_TSL_js from 'three/src/nodes/TSL.js';
5
5
  import { ShaderCallNodeInternal } from 'three/src/nodes/TSL.js';
6
6
  import * as _hello_terrain_work from '@hello-terrain/work';
7
- import { TaskRef } from '@hello-terrain/work';
7
+ import { TaskRef, Graph } from '@hello-terrain/work';
8
8
  import Node$1 from 'three/src/nodes/core/Node.js';
9
9
  import * as three_tsl from 'three/tsl';
10
10
 
@@ -34,17 +34,19 @@ declare class TerrainGeometry extends BufferGeometry {
34
34
  * | / | \ | / | \ |
35
35
  * o---o---o---o---o
36
36
  *
37
- * INNER GRID (consistent diagonal, no rotational symmetry):
38
- * o---o---o
39
- * | \ | \ |
40
- * o---o---o
41
- * | \ | \ |
42
- * o---o---o
37
+ * INNER GRID (alternating diagonals checkerboard pattern):
38
+ * o---o---o---o---o
39
+ * | \ | / | \ | / |
40
+ * o---o---o---o---o
41
+ * | / | \ | / | \ |
42
+ * o---o---o---o---o
43
+ * | \ | / | \ | / |
44
+ * o---o---o---o---o
43
45
  *
44
46
  * Where o = vertex
45
47
  * Each square cell is split into 2 triangles.
46
48
  * - Skirt cells (outer ring): diagonal flip based on quadrant for corner correctness
47
- * - Inner cells: consistent diagonal direction (all triangles "point" the same way)
49
+ * - Inner cells: alternating diagonal via (x+y)%2 to reduce interpolation artifacts
48
50
  *
49
51
  * Vertex layout (for innerSegments = 2):
50
52
  *
@@ -112,7 +114,7 @@ declare class TerrainMesh extends InstancedMesh {
112
114
  type ComputeStageCallback = (nodeIndex: Node, globalVertexIndex: Node, uv: Node, localCoordinates: Node, texelSize: Node) => void;
113
115
  type ComputePipeline = ComputeStageCallback[];
114
116
 
115
- /** Default compile task — uses normalFieldStageTask as the leaf. */
117
+ /** Default compile task — uses terrainFieldStageTask as the leaf. */
116
118
  declare const compileComputeTask: _hello_terrain_work.Task<{
117
119
  execute: (renderer: WebGPURenderer, instanceCount: number) => void;
118
120
  }, string, unknown>;
@@ -388,6 +390,36 @@ type CubeSphereSurfaceConfig = {
388
390
  */
389
391
  declare function createCubeSphereSurface(_cfg: CubeSphereSurfaceConfig): Surface;
390
392
 
393
+ type TerrainFieldStorageBackendType = "array-texture" | "atlas" | "texture-3d";
394
+ type TerrainFieldStorageFormat = "rgba16float" | "rgba32float";
395
+ type TerrainFieldStorageOptions = {
396
+ backend?: TerrainFieldStorageBackendType;
397
+ filter?: "nearest" | "linear";
398
+ format?: TerrainFieldStorageFormat;
399
+ };
400
+ interface TerrainFieldStorage {
401
+ readonly backendType: TerrainFieldStorageBackendType;
402
+ readonly edgeVertexCount: number;
403
+ readonly tileCount: number;
404
+ readonly texture: StorageArrayTexture | StorageTexture;
405
+ uv(ix: Node, iy: Node, tileIndex: Node): Node;
406
+ texel(ix: Node, iy: Node, tileIndex: Node): Node;
407
+ resize(width: number, height: number, tileCount: number): void;
408
+ }
409
+ declare function ArrayTextureBackend(edgeVertexCount: number, tileCount: number, options: Required<Pick<TerrainFieldStorageOptions, "format" | "filter">>): TerrainFieldStorage;
410
+ declare function AtlasBackend(edgeVertexCount: number, tileCount: number, options: Required<Pick<TerrainFieldStorageOptions, "format" | "filter">>): TerrainFieldStorage;
411
+ /**
412
+ * Placeholder backend for future true 3D storage-texture support in Three.js.
413
+ * We keep it present to preserve the backend API shape.
414
+ */
415
+ declare function Texture3DBackend(edgeVertexCount: number, tileCount: number, options: Required<Pick<TerrainFieldStorageOptions, "format" | "filter">>): TerrainFieldStorage;
416
+ declare function createTerrainFieldStorage(edgeVertexCount: number, tileCount: number, renderer?: WebGPURenderer, options?: TerrainFieldStorageOptions): TerrainFieldStorage;
417
+ declare function storeTerrainField(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node, value: Node): Node;
418
+ declare function loadTerrainField(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node): Node;
419
+ declare function loadTerrainFieldElevation(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node): Node;
420
+ declare function loadTerrainFieldNormal(storage: TerrainFieldStorage, ix: Node, iy: Node, tileIndex: Node): Node;
421
+ declare function packTerrainFieldSample(height: Node, normalXZ: Node, extra?: Node): Node;
422
+
391
423
  interface TerrainUniformsParams {
392
424
  rootSize: number;
393
425
  rootOrigin: Vector3Like;
@@ -429,11 +461,6 @@ interface ElevationFieldContext {
429
461
  attribute: StorageBufferAttribute;
430
462
  node: StorageBufferNode;
431
463
  }
432
- interface NormalFieldContext {
433
- data: Uint32Array<ArrayBuffer>;
434
- attribute: StorageBufferAttribute;
435
- node: StorageBufferNode;
436
- }
437
464
  /** Task refs for the standard terrain pipeline. */
438
465
  interface TerrainTasks {
439
466
  instanceId: TaskRef<string>;
@@ -447,14 +474,17 @@ interface TerrainTasks {
447
474
  positionNode: TaskRef<ShaderCallNodeInternal>;
448
475
  createElevationFieldContext: TaskRef<ElevationFieldContext>;
449
476
  createTileNodes: TaskRef<ReturnType<typeof createTileCompute>>;
450
- createNormalFieldContext: TaskRef<NormalFieldContext>;
477
+ createTerrainFieldTexture: TaskRef<TerrainFieldStorage>;
451
478
  elevationFieldStage: TaskRef<ComputePipeline>;
452
- normalFieldStage: TaskRef<ComputePipeline>;
479
+ terrainFieldStage: TaskRef<ComputePipeline>;
453
480
  compileCompute: TaskRef<{
454
481
  execute: (renderer: WebGPURenderer, instanceCount: number) => void;
455
482
  }>;
456
483
  executeCompute: TaskRef<void | (() => void)>;
457
484
  }
485
+ type TerrainGraph = Graph<string, {
486
+ renderer: WebGPURenderer;
487
+ }>;
458
488
 
459
489
  declare const createElevationFieldContextTask: _hello_terrain_work.Task<{
460
490
  data: Float32Array<ArrayBuffer>;
@@ -477,11 +507,9 @@ declare const elevationFieldStageTask: _hello_terrain_work.Task<ComputePipeline,
477
507
  /** Generates a unique instance ID per graph (cached once). */
478
508
  declare const instanceIdTask: _hello_terrain_work.Task<`${string}-${string}-${string}-${string}-${string}`, string, unknown>;
479
509
 
480
- declare const createNormalFieldContextTask: _hello_terrain_work.Task<{
481
- data: Uint32Array<ArrayBuffer>;
482
- attribute: StorageBufferAttribute;
483
- node: three_webgpu.StorageBufferNode;
484
- }, string, unknown>;
510
+ declare const createTerrainFieldTextureTask: _hello_terrain_work.Task<any, string, {
511
+ renderer: WebGPURenderer;
512
+ }>;
485
513
  /**
486
514
  * Normal field compute stage — reads height neighbors from the elevation field
487
515
  * buffer, computes surface normals via central differences, packs XZ
@@ -490,7 +518,7 @@ declare const createNormalFieldContextTask: _hello_terrain_work.Task<{
490
518
  *
491
519
  * Accumulates the upstream elevation pipeline via `get(elevationFieldStageTask)`.
492
520
  */
493
- declare const normalFieldStageTask: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
521
+ declare const terrainFieldStageTask: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
494
522
 
495
523
  interface ElevationParams {
496
524
  worldPosition: Node$1;
@@ -514,7 +542,7 @@ declare const origin: _hello_terrain_work.ParamRef<{
514
542
  }>;
515
543
  /**
516
544
  * Number of segments per inner tile edge.
517
- * 13 is the max tiles we can support for 256 workgroups (13 + 3 === 16.. 16x16)
545
+ * Effective edge vertex count is `innerTileSegments + 3`.
518
546
  */
519
547
  declare const innerTileSegments: _hello_terrain_work.ParamRef<number>;
520
548
  /** Skirt scale factor. */
@@ -536,11 +564,10 @@ declare const elevationFn: _hello_terrain_work.ParamRef<ElevationCallback>;
536
564
  * Builds the TSL position node for the terrain shader.
537
565
  *
538
566
  * Depends on leafStorageTask (buffer objects), createUniformsTask
539
- * (uniform nodes), createElevationFieldContextTask (elevation field storage),
540
- * and createNormalFieldContextTask (normal field storage).
567
+ * (uniform nodes), and createTerrainFieldTextureTask (combined terrain field storage).
541
568
  *
542
- * The position node also reads normals from the normal field buffer
543
- * per-vertex (using vertexIndex) and assigns them to the vNormal
569
+ * The position node reads packed terrain samples (height + normal.xz)
570
+ * per-vertex and assigns them to the vNormal
544
571
  * varying for use in the fragment shader.
545
572
  *
546
573
  * These only change when their GPU resources are recreated
@@ -589,9 +616,7 @@ declare const createUniformsTask: _hello_terrain_work.Task<TerrainUniformsContex
589
616
  */
590
617
  declare const updateUniformsTask: _hello_terrain_work.Task<TerrainUniformsContext, string, unknown>;
591
618
 
592
- declare function terrainGraph(): _hello_terrain_work.Graph<string, {
593
- renderer: WebGPURenderer;
594
- }>;
619
+ declare function terrainGraph(): TerrainGraph;
595
620
  /** All terrain task refs for direct access. */
596
621
  declare const terrainTasks: {
597
622
  readonly instanceId: _hello_terrain_work.Task<`${string}-${string}-${string}-${string}-${string}`, string, unknown>;
@@ -623,13 +648,11 @@ declare const terrainTasks: {
623
648
  rootUVCompute: three_src_nodes_TSL_js.ShaderNodeFn<[number | three_webgpu.Node, number | three_webgpu.Node, number | three_webgpu.Node]>;
624
649
  tileVertexWorldPositionCompute: three_src_nodes_TSL_js.ShaderNodeFn<[number | three_webgpu.Node, number | three_webgpu.Node, number | three_webgpu.Node]>;
625
650
  }, string, unknown>;
626
- readonly createNormalFieldContext: _hello_terrain_work.Task<{
627
- data: Uint32Array<ArrayBuffer>;
628
- attribute: three_webgpu.StorageBufferAttribute;
629
- node: three_webgpu.StorageBufferNode;
630
- }, string, unknown>;
651
+ readonly createTerrainFieldTexture: _hello_terrain_work.Task<any, string, {
652
+ renderer: WebGPURenderer;
653
+ }>;
631
654
  readonly elevationFieldStage: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
632
- readonly normalFieldStage: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
655
+ readonly terrainFieldStage: _hello_terrain_work.Task<ComputePipeline, string, unknown>;
633
656
  readonly compileCompute: _hello_terrain_work.Task<{
634
657
  execute: (renderer: WebGPURenderer, instanceCount: number) => void;
635
658
  }, string, unknown>;
@@ -638,6 +661,13 @@ declare const terrainTasks: {
638
661
  }>;
639
662
  };
640
663
 
664
+ type ComputeDeviceLimits = {
665
+ maxWorkgroupSizeX: number;
666
+ maxWorkgroupSizeY: number;
667
+ maxWorkgroupInvocations: number;
668
+ };
669
+ declare function getDeviceComputeLimits(renderer: WebGPURenderer): ComputeDeviceLimits;
670
+
641
671
  /**
642
672
  * Maps a value or node from texture space [0, 1] to vector space [-1, 1].
643
673
  *
@@ -710,5 +740,5 @@ declare const voronoiCells: three_src_nodes_TSL_js.ShaderNodeFn<[three_tsl.Proxi
710
740
  uv: Node;
711
741
  }>]>;
712
742
 
713
- export { Dir, TerrainGeometry, TerrainMesh, U32_EMPTY, allocLeafSet, allocSeamTable, beginUpdate, blendAngleCorrectedNormals, buildLeafIndex, buildSeams2to1, compileComputeTask, createComputePipelineTasks, createCubeSphereSurface, createElevationFieldContextTask, createFlatSurface, createInfiniteFlatSurface, createNormalFieldContextTask, createSpatialIndex, createState, createTerrainUniforms, createUniformsTask, deriveNormalZ, elevationFieldStageTask, elevationFn, elevationScale, executeComputeTask, innerTileSegments, instanceIdTask, isSkirtUV, isSkirtVertex, leafGpuBufferTask, leafStorageTask, maxLevel, maxNodes, normalFieldStageTask, origin, positionNodeTask, quadtreeConfigTask, quadtreeUpdate, quadtreeUpdateTask, resetLeafSet, resetSeamTable, rootSize, skirtScale, surface, surfaceTask, terrainGraph, terrainTasks, textureSpaceToVectorSpace, tileNodesTask, update, updateUniformsTask, vElevation, vGlobalVertexIndex, vectorSpaceToTextureSpace, voronoiCells };
714
- export type { ComputePipeline, ComputeStageCallback, CubeSphereSurfaceConfig, ElevationCallback, ElevationFieldContext, ElevationParams, FlatSurfaceConfig, InfiniteFlatSurfaceConfig, IntNodeInput, LeafGpuBufferState, LeafSet, LeafStorageState, LodMode, NormalFieldContext, QuadtreeConfig, QuadtreeConfigState, QuadtreeState, SeamTable, SpatialIndex, Surface, TerrainTasks, TerrainUniformsContext, TerrainUniformsParams, TileBounds, TileId, UpdateParams };
743
+ export { ArrayTextureBackend, AtlasBackend, Dir, TerrainGeometry, TerrainMesh, Texture3DBackend, U32_EMPTY, allocLeafSet, allocSeamTable, beginUpdate, blendAngleCorrectedNormals, buildLeafIndex, buildSeams2to1, compileComputeTask, createComputePipelineTasks, createCubeSphereSurface, createElevationFieldContextTask, createFlatSurface, createInfiniteFlatSurface, createSpatialIndex, createState, createTerrainFieldStorage, createTerrainFieldTextureTask, createTerrainUniforms, createUniformsTask, deriveNormalZ, elevationFieldStageTask, elevationFn, elevationScale, executeComputeTask, getDeviceComputeLimits, innerTileSegments, instanceIdTask, isSkirtUV, isSkirtVertex, leafGpuBufferTask, leafStorageTask, loadTerrainField, loadTerrainFieldElevation, loadTerrainFieldNormal, maxLevel, maxNodes, origin, packTerrainFieldSample, positionNodeTask, quadtreeConfigTask, quadtreeUpdate, quadtreeUpdateTask, resetLeafSet, resetSeamTable, rootSize, skirtScale, storeTerrainField, surface, surfaceTask, terrainFieldStageTask, terrainGraph, terrainTasks, textureSpaceToVectorSpace, tileNodesTask, update, updateUniformsTask, vElevation, vGlobalVertexIndex, vectorSpaceToTextureSpace, voronoiCells };
744
+ export type { ComputePipeline, ComputeStageCallback, CubeSphereSurfaceConfig, ElevationCallback, ElevationFieldContext, ElevationParams, FlatSurfaceConfig, InfiniteFlatSurfaceConfig, IntNodeInput, LeafGpuBufferState, LeafSet, LeafStorageState, LodMode, QuadtreeConfig, QuadtreeConfigState, QuadtreeState, SeamTable, SpatialIndex, Surface, TerrainFieldStorage, TerrainFieldStorageBackendType, TerrainFieldStorageFormat, TerrainFieldStorageOptions, TerrainGraph, TerrainTasks, TerrainUniformsContext, TerrainUniformsParams, TileBounds, TileId, UpdateParams };