Table of Contents

Class HiLoLattice

Namespace
LansMap.Map.Rendering

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
object
HiLoLattice

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

double

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

mercator double

Absolute normalized mercator coordinate, one world spanning 0 to 1.

hi float

Coarse half, snapped down to the PositionGrid lattice.

lo float

Fine 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.