eulerjs API / @eulerjs/marine / WaterLod
WaterLod
Defined in: packages/marine/src/three/waterLod.ts:7
Level of detail of the water mesh: a square grid of chunks that get coarser away from the centre. Every chunk's vertex count is a multiple of one unit, so moving the whole mesh by snapStep lands every vertex back on a position some vertex had before and the triangles don't crawl while the mesh follows the camera target.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
baseSpacing | readonly | number | Vertex spacing of the centre chunks, in metres. | packages/marine/src/three/waterLod.ts:11 |
counts | readonly | readonly (readonly number[])[] | Grid segments across each chunk, indexed [row][column]. | packages/marine/src/three/waterLod.ts:9 |
growth | readonly | number | The shader grows the spacing continuously as baseSpacing * growth^(distance / chunkSize), which never undershoots any chunk's real spacing; neighbouring chunks therefore agree on which waves exist along their shared edge. | packages/marine/src/three/waterLod.ts:17 |
snapStep | readonly | number | Distance the mesh moves in when following, in metres. | packages/marine/src/three/waterLod.ts:19 |
