UnlitMaterial class Materials
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 the base shader library.
Constructors
- UnlitMaterial({TextureSource? colorTexture})
- Creates an UnlitMaterial, optionally textured.
Properties
- alphaMode ↔ AlphaMode
-
How the material's alpha is interpreted. AlphaMode.opaque ignores
alpha; AlphaMode.blend routes the material through the depth-sorted
translucent pass with alpha blending (use for widget textures and
other surfaces with transparency).
getter/setter pair
- baseColorFactor ↔ Vector4
-
Linear RGBA tint multiplied with baseColorTexture.
getter/setter pair
- baseColorTexture ↔ TextureSource?
-
The base color texture, sampled and multiplied by baseColorFactor.
getter/setter pair
- baseColorTextureTexCoord ↔ int
-
Texture-coordinate channel used by baseColorTexture.
getter/setter pair
- baseColorTextureTransform ↔ TextureTransform
-
UV transform applied to baseColorTexture.
getter/setter pair
- depthBias ↔ double
-
World-space offset toward the camera used for coplanar surface details.
Positive values keep an overlay in front of its supporting surface
without modifying its node transform. Zero and negative values leave the
draw position unchanged.
getter/setter pairinherited
- depthLayer ↔ int
-
Which surface wins where this material's geometry and another's lie in
the same plane. A surface with a higher layer draws over coplanar
surfaces with a lower one, at any distance and on every backend.
getter/setter pairinherited
- displayReferred ↔ bool
-
Treats baseColorTexture and baseColorFactor as display-referred
(final screen values) instead of scene-referred radiance.
getter/setter pairoverride-getter
- 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
- lodCrossFades → bool
-
Whether this material cross-fades between levels of detail. An opaque
draw of one that is mid-fade takes the coverage pre-draw, which dithers
it against the adjacent level. The built-in lit and unlit materials do.
no setter
- name ↔ String
-
The name of this material, used for identification.
getter/setter pairinherited
- participatesInDebugViews → bool
-
Whether this material's fragment shader declares the
DebugViewInfoblock and switches on it (seematerial_debug.glsl), so the scene's surface debug views can show its resolved surface.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sceneInputs
→ Set<
RenderInput> -
Per-frame engine inputs this material samples, produced only when a
visible material asks for them: RenderInput.depth binds the linear
scene depth of the opaque geometry (forcing the depth prepass), and
RenderInput.opaqueSceneColor binds the accumulated scene color behind
the current draw, and RenderInput.filteredSceneColor adds its
roughness-filtered atlas.
Together they enable refraction, depth-fade absorption, shoreline
foam, and soft-particle style effects on translucent surfaces. The
base material requests nothing; a
.fmatmaterial declares these withengine_inputs:.no setterinherited - vertexColorWeight ↔ double
-
How strongly per-vertex colors influence the final color.
0disables vertex color contribution;1(the default) fully applies it.getter/setter pair
Methods
-
bind(
RenderPass pass, TransientWriter 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.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setFragmentShader(
Shader shader) → void -
Assigns the fragment
shaderused when this material is drawn.inherited -
setFragmentShaderName(
String name, {String? cubeName, String? noShadowName, String? noShadowCubeName}) → void -
Assigns the fragment shader by
namefrom baseShaderLibrary.inherited -
setRadianceCubeFragmentShader(
Shader? shader) → void -
Assigns the already-loaded variant built with
FLUTTER_SCENE_RADIANCE_CUBE, the counterpart of setFragmentShader for a material that samples the environment.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited