Saman
  • Projects
  • Gallery
  • Blog
  • Resume
GitHub

Build experiments. Learn constantly. Ship iteratively.

Next.jsTypeScriptGSAPThree.jsLenisTailwind
  • GitHub
  • LinkedIn
  • Instagram
  • Saman Sahraei
  • Projects
  • Resume
  • Blog
  • Gallery

© 2026 Saman Sahraei

←All notes
Published August 21, 202510 min readSaman Sahraei

GPU-Friendly Overlays on Top of MapLibre

Synchronising Three.js with MapLibre, instancing markers, and keeping 60 FPS when the camera moves.

WebGLThree.jsMapLibre
GPU-Friendly Overlays on Top of MapLibre by Saman Sahraei

A 3D map overlay is really two renderers sharing one camera illusion. MapLibre owns the basemap; Three.js draws on top. If those cameras drift even slightly, the entire effect breaks trust immediately.

Instancing is non-negotiable

Drawing one mesh per order point will not survive past a few thousand features. InstancedMesh pushes marker transforms to the GPU in a single draw call. Level-of-detail culling trims instances outside the frustum before they hit the pipeline.

  • ◆Custom layer hook for MapLibre + Three.js sync
  • ◆Mercator projection helpers for world-space alignment
  • ◆Lazy-loaded demo chunks so routes stay lightweight
  • ◆Reduced motion and mobile fallbacks where WebGL is constrained
Performance on a map is not a benchmark score — it is whether panning still feels like touching paper.

More notes

December 8, 2025

Real-Time Frontend Architecture

How to separate event throughput from render throughput using normalization, buffering, batch processing, and selective subscriptions in high-frequency dashboards.

November 12, 2025

Tile-Based Caching for Interactive Maps

How square tile keys, spatial caches, and zoom-aware fetching keep dense vendor maps responsive without blocking the UI thread.

October 3, 2025

React Query Patterns for Live Portfolio Demos

Stale times, refetch intervals, and optimistic UI for dashboards that look alive without pretending to be production infrastructure.