View on GitHub

leaflet-city-mapper

A small 3D rendering engine for leaflet

Textures

Source guide Project README

Manages image uploads and GPU textures for scene meshes, models and native layers, including the raster atlas used for roofs.

Upload, reuse and release

flowchart LR
  Model["Model images"] --> Cache["Texture cache: color / data"]
  Native["Native images"] --> Upload["GPU texture upload"]
  Cache --> Upload
  Rasters["Raster versions / opacity / order"] --> Atlas["Roof atlas"]
  Atlas --> Upload
  Upload --> Bind["Mesh bind group"]
  Bind --> Draw["Render"]
  Draw --> Release["Destroy after submitted work"]

Atlas rebuilds are throttled while tiles load. Binding changes trigger a bind group rebuild; resource destruction must wait for submitted GPU work.

Related: materials, raster, native.