Class HiLoLattice
Splits an absolute normalized mercator coordinate into the coarse/fine float pair the instanced GPU layers store, so the vertex shader can subtract the anchor itself instead of the CPU baking it in at upload.
public static class HiLoLattice
- Inheritance
-
objectHiLoLattice
Fields
PositionGrid
Steps per world that the coarse half is snapped to; one step is about 38 m at the equator.
public const double PositionGrid = 1048576
Field Value
Methods
Split(double, out float, out float)
Splits one absolute normalized mercator coordinate into the hi/lo pair the GPU buffers store.
public static void Split(double mercator, out float hi, out float lo)
Parameters
mercatordoubleAbsolute normalized mercator coordinate, one world spanning 0 to 1.
hifloatCoarse half, snapped down to the PositionGrid lattice.
lofloatFine remainder, at or above 0 and below one grid step.
Remarks
Both halves must come from this one method, instance positions and anchor alike: the shader's exact-subtraction property holds only while every hi it sees sits on the same lattice.