RenderPatch

interface RenderPatch
terrainMesh.ts:112

Members

anchorreadonly

anchor: Vec3

The patch's origin: the datum-sphere point at its center, in body-fixed axes. Every vertex is measured from here, and patchPlacement turns it back into a render-space position.

boundsCenterreadonly

boundsCenter: Vec3

Bounding sphere in the same anchor-relative axes the vertices are in.

boundsRadiusreadonly

boundsRadius: number

coverreadonly

cover: Uint8Array

Surface cover per vertex, COVER_CHANNELS bytes, as generated.

The one buffer here that is PatchInput's own array rather than a fresh one — the heightfield's, which the caller may still be holding in a field cache. Nothing writes to it, and copying 17 KB a patch to say so is the expensive half of terrain's memory paid twice; but a producer that ever pools or rewrites a heightfield has to know this attribute is a view of it.

indicesreadonly

indices: Uint32Array

Shared between every patch of this resolution; see patchIndices.

morphCoverreadonly

morphCover: Uint8Array

And the cover it wears once morphed: the parent's, at the parent's vertex.

The material has to hand over with the geometry for the same reason the normal does. A fully morphed child sits exactly where its parent sits, so if it is still wearing its own vertex's cover there, the frame the parent takes over is the frame every ray and every mare edge jumps by one child cell — a shimmering ring at the morph band rather than a pop, which is worse because it does not stop.

morphNormalsreadonly

morphNormals: Float32Array

The normal it shades with there — the parent's, over the parent's cells.

morphPositionsreadonly

morphPositions: Float32Array

Where each vertex sits once fully morphed onto the parent's grid.

normalsreadonly

normals: Float32Array

Unit normals in body-fixed axes, exact everywhere including the edge.

positionsreadonly

positions: Float32Array

xyz triples in body-fixed axes, relative to anchor.

regionreadonly

resolutionreadonly

resolution: number

spacingreadonly

spacing: number

Ground one grid cell covers: the patch's own LOD error, in meters.

waterreadonly

water: WaterPatch | null

The sea over this patch, or null where the sea reaches none of it.