sampleOffset

function sampleOffset
universe/src/terrainKernel.ts:787
sampleOffset(region: RegionAddress, s: number, t: number) → Vec3

The offset of a sample from its tile's center, in float64 — the arithmetic the kernel performs in float32, written once here so a test can hold the two together and so the frame's own claim can be checked without a GPU.

Nothing subtracts two unit vectors. raw = raw0 + Δ with Δ exact, and d − d0 = Δ/|raw| − d0 · w/(n(1 + n)) where w = (2 raw0·Δ + Δ·Δ)/|raw0|² and n = √(1 + w) — every term small and every one built from Δ, so the result is exact to the precision of Δ rather than to the precision of a unit vector.

regionRegionAddress
Undocumented
snumber
Undocumented
tnumber
Undocumented
ReturnsVec3