View on GitHub

leaflet-city-mapper

A small 3D rendering engine for leaflet

Materials

Source guide Project README

Builds GPU material programs, layouts and uniforms, converts model materials, and handles terrain and roof material requirements.

Material to GPU program

flowchart LR
  Model["glTF material"] --> Convert["Convert material"]
  Convert --> Features["Material features"]
  Features --> WGSL["Generate WGSL + bindings"]
  Features --> Layout["Program layout + uniforms"]
  WGSL --> Program["GPU program / pipeline cache"]
  Layout --> Program
  Textures["Texture uploads"] --> Program

Shader declarations, binding order, uniforms and mesh attributes must agree. Compilation diagnostics are reported through gpu.

Related: shaders, textures, rendering.