BundledMaterials class final
The lighting models of the materials a bundle was built from, read off
the sources the bundle carries — P8.
What a game draws a built .f3dmat with. The build compiles each
source into a stage of the bundle and keeps the source beside it; this
reads the source back and builds the LightingModel from the program
itself, through MaterialBindings.lightingModel, so which maps it samples
and whether it reads the light list are the program's answers rather than
a second description by hand. Load the same bytes with
GraphicsDevice.loadShaders and hand the library to the renderer as its
materials; a RenderMaterial whose lighting is one of these draws the
stage of that name, on every backend that has a section for it.
- Available extensions
Constructors
- BundledMaterials.read(ByteData bytes)
-
Reads
bytes, a bundle asGraphicsDevice.loadShaderstakes it.factory
Properties
- bundle → ShaderBundle
-
The bundle, decoded.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
lighting
→ Map<
String, LightingModel> -
Each material's lighting model, by its name, which is also its stage's.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stages
→ Map<
String, MaterialBindings> -
Every source the bundle carries, by its name — a surface's, a
full-screen stage's and a kernel's alike — version 2.
final
Methods
-
material(
String name, {String? materialName}) → RenderMaterial -
Available on BundledMaterials, provided by the BundledMaterialLooks extension
A new RenderMaterial drawn with materialname: its lighting model, its uniforms at their defaults (BundledMaterials.parameters), and what itsstateblock says — the blend, the cutoff, the depth write and test, alpha to coverage, double-sidedness, the depth layer and the effects depth. What the file leaves unsaid keeps RenderMaterial's own default, and every field stays the game's to change. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parameters(
String name) → MaterialParameters -
What
RenderMaterial.parametersstarts as for materialname: eachuniformthe source declares, at its default, checked against schema —P8. Fresh values every call, so one material's edits are not another's. Empty for a material with no uniform. -
schema(
String name) → MaterialParameterSchema -
What material
namelets a draw set: eachuniformits source declares, its width and its default, as the bundle carries them — the schema parameters checks against. A bundle keeps noparam, which is folded into its stages. Throws an ArgumentError naming the materials the bundle has. -
state(
String name) → MaterialFileState -
What material
name'sstateblock says — version 2. MaterialFileState.none for a source without one. Throws an ArgumentError naming the materials the bundle has. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
String name) → LightingModel -
The lighting model of material
name. Throws an ArgumentError naming the ones the bundle has, rather than handing back nothing to draw with.