LevelMaterial class final
How a surface is shaded, named so brushes can share one.
Constructors
-
LevelMaterial({LinearColor? baseColor, double roughness = 0.85, double metallic = 0.0, LinearColor? emissive, double emissiveStrength = 0.0, double texelsPerMeter = 1.0, String? albedo, String? normal, String? orm, String? fmat, int depthLayer = 0, MaterialParameters? parameters, int? materialVersion, String? physicalMaterial, Map<
String, Object?> source = const <String, Object?>{}}) - A material, mid grey and rough unless told otherwise.
-
LevelMaterial.fromJson(Map<
String, Object?> json) -
Reads a material from its level row, the base colour in sRGB, keeping
the row for toJson. Throws a LevelFormatException for a field of
the wrong shape.
factory
Properties
- albedo → String?
-
Asset path of the base colour map, relative to the game's assets.
final
- baseColor → LinearColor
-
The surface's colour, in linear light, and its coverage in alpha.
final
- depthLayer → int
-
Which depth layer a surface in this material is drawn on, unless its
brush says another — see
Brush.depthLayer.final - emissive → LinearColor?
-
The colour the surface glows in, linear, or null for the colour it is
painted (baseColor), which is what every level written before 1.0
glows in. The document's
emissiveColor, written only when set.final - emissiveStrength → double
-
How brightly the surface glows, a ratio: a plain multiple of
RenderMaterial.defaultEmissiveStrength, as a level has always stored it. Zero is not lit. The document'semissivekey, unchanged, so a level reads and writes the number it did.final - fmat → String?
-
A standalone material file this surface defers its whole look to.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasMaps → bool
-
Whether anything here has to be loaded from disk.
no setter
- materialVersion → int?
-
The version of that material parameters were written for: its
material Name version N. Null for a level that predates material versions, which is read as version 1.final - metallic → double
-
Metalness, a 0..1 factor: 0 is a dielectric, 1 is bare metal.
final
- normal → String?
-
Tangent-space normal map, OpenGL convention — green points up.
final
- orm → String?
-
glTF's packing: occlusion in red, roughness in green, metallic in blue.
final
- parameters → MaterialParameters
-
The values this surface gives the parameters of the material it is
drawn with, when that material is written in the engine's material
language: each a parameter's name and its components.
final
- physicalMaterial → String?
-
The substance a surface in this material is made of, as a body and a
sound feel it: the id of a material in the engine's
MaterialCatalog(f3d.concrete,<pluginId>.basalt), or null for none named. A level naming one no installed plugin declares is refused (Level.requireMaterials).final - roughness → double
-
Perceptual roughness, a 0..1 factor: 0 is a mirror, 1 is chalk.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storedBaseColor → SrgbColor
-
baseColor as the document stores it: sRGB-encoded, rounded to single
precision, which is what a level file has always said.
no setter
- texelsPerMeter → double
-
Texture repeats per metre: the UV span one metre of a face covers.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> - This material as a level row, written through the row it was read from.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited