MaterialSlotTable class final

What a material binds beyond the engine's own: its uniform blocks and its own textures, in a fixed order (D21).

The contract between a plugin's lit model and every backend. The engine's lit stages bind five textures and the engine's blocks; a model of a plugin's own — hair, cloth, a subsurface lobe — needs more. Its source declares them (uniform(Hair) vec3 tint = …;, texture fur;), this table lists them, and:

  • the GLSL emitter declares each block and sampler under these names;
  • each backend's binding plan maps an entry to its own binding — by name on WebGL2, Impeller and the software backend, by group and binding number on WebGPU, numbered in this order after the engine's (see "The shader ABI" in docs/CONTRACTS.md);
  • the renderer binds each block from RenderMaterial.parameters (the members that belong to it, each member the material leaves unset at its MaterialBlockMember.defaultValue) and each texture from RenderMaterial.extraTextures under its MaterialTextureSlotEntry.binding, a white texel where the material names none: every slot of the table is bound on every draw.

The order is the order of declaration in the source, MaterialParams first when the material has a uniform of its own, and is part of the contract: a backend that numbers bindings numbers them in it.

Constructors

MaterialSlotTable({List<MaterialBlockSlot> blocks = const <MaterialBlockSlot>[], List<MaterialTextureSlotEntry> textures = const <MaterialTextureSlotEntry>[]})
A table of blocks and textures, in binding order; empty unless given.
const
MaterialSlotTable.of(MaterialProgram program)
program's table: a block per block its uniforms are members of, and an entry per texture of its own.
factory

Properties

blocks → List<MaterialBlockSlot>
The material's uniform blocks, MaterialParams first when it has one, then in declaration order.
final
hashCode → int
The hash code for this object.
no setterinherited
isEmpty → bool
Whether the material binds nothing of its own.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textures → List<MaterialTextureSlotEntry>
The material's own textures, in declaration order.
final

Methods

block(String name) → MaterialBlockSlot?
The block called name, or null.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
The table as the bundle writer carries it beside a stage.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

std140(List<MaterialParameter> uniforms) → List<MaterialBlockMember>
uniforms laid out as std140 lays the block the emitter writes.

Constants

none → const MaterialSlotTable
A material that binds nothing beyond the engine's own.