API contracts for material authoring and compilation boundary.
Entrypoints
defineMaterial(input)
Validates and freezes material definitions. Use this for all user-facing material creation.
Input: FragMaterialInput
Output: FragMaterial
Immutable, validated object with frozen top-level maps:
fragmentuniformstexturesdefinesincludesstorageBuffers
signature and preprocessed WGSL are internal runtime outputs, not public fields of FragMaterial.
resolveMaterial(material)
Framework-agnostic core helper that turns a validated FragMaterial into runtime-ready payload:
- preprocessed WGSL source
- uniform layout metadata
- texture metadata (including storage +
fragmentVisibleconfig) - storage buffer keys and definitions
- storage texture keys
- deterministic material signature
Use this in adapter implementations or low-level tooling.