UnlitMaterial class

A material that draws geometry with a flat color or texture, ignoring scene lighting.

Useful for UI overlays, debug visualization, or stylized rendering. The final color is baseColorFactor * baseColorTexture, optionally blended with the per-vertex color via vertexColorWeight.

Wraps the UnlitFragment shader from baseShaderLibrary.

Inheritance

Constructors

UnlitMaterial({Texture? colorTexture})
Creates an UnlitMaterial, optionally textured.

Properties

baseColorFactor ↔ Vector4
Linear RGBA tint multiplied with baseColorTexture.
getter/setter pair
baseColorTexture Texture
The base color texture, sampled and multiplied by baseColorFactor.
getter/setter pair
doubleSided bool
Whether to render both faces of triangles drawn with this material (glTF's material.doubleSided). When true, bind disables back-face culling so the geometry is visible from both sides; otherwise back faces are culled. Defaults to false. The runtime importer sets it from the glTF material.
getter/setter pairinherited
fragmentShader Shader
The fragment shader used when rendering geometry with this material.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
vertexColorWeight double
How strongly per-vertex colors influence the final color. 0 disables vertex color contribution; 1 (the default) fully applies it.
getter/setter pair

Methods

bind(RenderPass pass, HostBuffer transientsBuffer, Lighting lighting) → void
Binds this material's render-pass state, uniforms, and textures.
override
isOpaque() bool
Whether geometry rendered with this material is fully opaque.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setFragmentShader(Shader shader) → void
Assigns the fragment shader used when this material is drawn.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

fromFlatbuffer(Material fbMaterial, List<Texture> textures) UnlitMaterial
Builds an UnlitMaterial from a flatbuffer material description, resolving texture indices against textures.
override