SurfaceMaterial class final

Format-neutral description of how a surface looks.

The single material abstraction every decoder produces. Metal-rough is the target because it is what glTF defines and what the shaders implement; formats that predate it (OBJ's Phong parameters) are approximated at decode time, with the approximation documented where it happens rather than hidden.

Constructors

SurfaceMaterial({String? name, Vector4? baseColor, double metallic = 0.0, double roughness = 0.5, TextureBinding? baseColorTexture, TextureBinding? metallicRoughnessTexture, TextureBinding? normalTexture, double normalScale = 1.0, TextureBinding? occlusionTexture, double occlusionStrength = 1.0, TextureBinding? emissiveTexture, Vector3? emissive, double emissiveStrength = 1.0, SurfaceAlphaMode alphaMode = SurfaceAlphaMode.opaque, double alphaCutoff = 0.5, bool doubleSided = false, bool unlit = false, LightingModel? lightingModel, Map<String, Object?>? extras})

Properties

alphaCutoff → double
final
alphaMode → SurfaceAlphaMode
final
baseColor → Vector4
RGBA tint as authored, i.e. non-linear for the colour channels.
final
baseColorTexture → TextureBinding?
final
doubleSided → bool
final
emissive → Vector3
final
emissiveStrength → double
final
emissiveTexture → TextureBinding?
final
extras → Map<String, Object?>?
glTF's own extras on this material, carried opaquely — see ModelNode.extras for what that means and why.
final
hashCode → int
The hash code for this object.
no setterinherited
lightingModel → LightingModel?
Which of LightingModel.builtIn this surface asks the renderer to shade with, or null when the document never said — every decoder built before this field existed leaves it null, and a null reader falls back to LightingModel.unlit or LightingModel.pbr by unlit the same way the renderer's own default already did.
final
metallic → double
final
metallicRoughnessTexture → TextureBinding?
final
name → String?
final
normalScale → double
final
normalTexture → TextureBinding?
final
occlusionStrength → double
final
occlusionTexture → TextureBinding?
final
roughness → double
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
unlit → bool
Shade with albedo only, from glTF's KHR_materials_unlit or an OBJ material with no specular response at all.
final

Methods

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

Operators

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