O(1) GPU vertex slicing: 250,000 points without PCIe memory reallocation
In planetary particle visualizers, scaling point density dynamically usually incurs a heavy frame penalty — either through CPU-side vertex buffer re-allocations or repetitive gl.bufferData bus uploads.
TerraGemini eliminates this overhead by pre-generating a maximum pool of 250,000 spherical surface points during the initial raster pass. Each point is importance-ranked (evaluating coastline distance and spatial dispersion) and packed into a single static interleaved vertex buffer ([lon, lat, edge_strength, rank], 16 bytes per vertex) uploaded once at startup.
When the user scrubs the point density slider:
- No CPU memory is allocated.
- Zero vertex bytes are transferred across the PCIe bus.
- The WebGL draw loop executes an range slice:
const renderPoints = Math.min(250000, Math.max(50000, Math.floor(targetDensity)));
gl.drawArrays(gl.POINTS, 0, renderPoints);Visual presets are managed identically: rather than recompiling shaders or modifying preprocessor #ifdef branches, uniform color vectors smoothly lerp toward target presets via exponential decay () on every frame. The result is instant, 60fps responsiveness across the entire density range.