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.
- createProgram.js: create a material program.
- createProgramLayout.js: configure GPU bindings.
- modelMaterialFor.js: derive materials from model data.