MaterialData class final

A glTF metallic-roughness material, with the extensions this renderer reads (KHR_materials_unlit, KHR_materials_emissive_strength, KHR_texture_transform).

Constructors

MaterialData({String? name, (double, double, double, double) baseColor = (1.0, 1.0, 1.0, 1.0), TextureRef? baseColorTexture, double metallic = 1.0, double roughness = 1.0, TextureRef? metallicRoughnessTexture, TextureRef? normalTexture, double normalScale = 1.0, TextureRef? occlusionTexture, double occlusionStrength = 1.0, (double, double, double) emissive = (0.0, 0.0, 0.0), TextureRef? emissiveTexture, double emissiveStrength = 1.0, AlphaMode alphaMode = AlphaMode.opaque, double alphaCutoff = 0.5, bool doubleSided = false, bool unlit = false, UvMode uvMode = UvMode.natural, bool layered = false, (double, double, double, double) layerTiling = (1.0, 1.0, 1.0, 1.0)})
A material; defaults are the glTF spec's.
const

Properties

alphaCutoff → double
Cutoff for AlphaMode.mask.
final
alphaMode → AlphaMode
How alpha is used.
final
baseColor → (double, double, double, double)
Linear RGBA multiplier.
final
baseColorTexture → TextureRef?
sRGB base colour texture.
final
doubleSided → bool
Whether back faces are drawn too.
final
emissive → (double, double, double)
Linear emissive colour.
final
emissiveStrength → double
KHR_materials_emissive_strength multiplier.
final
emissiveTexture → TextureRef?
sRGB emissive texture.
final
hashCode → int
The hash code for this object.
no setterinherited
layered → bool
Four colour layers instead of the maps: base colour, metal-rough, normal and occlusion hold the layers, blended by the vertex colour (R, G, B, A weigh them) and read in world coordinates tiled per metre by layerTiling. What a terrain is painted with. No normal map then.
final
layerTiling → (double, double, double, double)
How many times each of the four layers repeats per metre.
final
metallic → double
Metalness, 0..1.
final
metallicRoughnessTexture → TextureRef?
Roughness in G, metalness in B.
final
name → String?
Name in the file.
final
normalScale → double
Scale of the normal map's x and y.
final
normalTexture → TextureRef?
Tangent-space normal map.
final
occlusionStrength → double
How much occlusion applies, 0..1.
final
occlusionTexture → TextureRef?
Ambient occlusion in R.
final
roughness → double
Roughness, 0..1.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
unlit → bool
KHR_materials_unlit: base colour only, no lighting.
final
uvMode → UvMode
Where its textures are read: the mesh's own UVs, or the world's coordinates seen along the face's main axis — tiled per metre by the base colour texture's scale, the same on every face and size.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

fallback → const MaterialData
The material used where a primitive names none.