Hardware-accelerated country picking: 24-bit bijective RGB buffers
Evaluating point-in-polygon raycasts across 180+ TopoJSON country boundaries during real-time continuous projection morphing causes heavy CPU bottlenecks and dropped frames.
GeoGenesis replaces geometric hit-testing with an off-screen 24-bit bijective RGB color-picking buffer.
1. 24-Bit Bijective Integer Encoding
Each country feature index is mapped to a unique 24-bit integer :
Decoding the pixel value read under the cursor:
If , the pointer is over ocean or void ().
2. Zero-Stall Host Memory Pinning
The off-screen canvas context is initialized with { willReadFrequently: true }. This pins the backing buffer in host memory, eliminating GPU-to-CPU pipeline stalls during ctx.getImageData() calls. Pointer inspection executes in ( constant time) regardless of polygon complexity.