MaterialAlphaMode enum
How a material treats the alpha channel, mirroring glTF's alphaMode.
The renderer uses this to split draws into the opaque and transparent halves of the render list, in the manner of PlayCanvas sub-layers.
Values
- opaque → const MaterialAlphaMode
- mask → const MaterialAlphaMode
- blend → const MaterialAlphaMode
- hashed → const MaterialAlphaMode
-
Kept or dropped per pixel against noise instead of a threshold —
gfx-16n's own row, and the one mode here that glTF has no word for.What it is for: foliage and nets. A leaf texture at 40% opacity is either entirely there or entirely gone under mask, so a fern comes out as a hard-edged cut-out; blend draws it correctly and needs the geometry sorted, which costs a sort per frame and defeats instancing. Hashed keeps 40% of the pixels and resolves as 40% opacity to anything that averages several of them.
It is drawn in the opaque half, writes depth, and needs no sorting — which is the whole point — at the price of visible noise anywhere the result is not averaged down. Without temporal accumulation this engine does not have, that price is real: it suits a supersampled render or a distant canopy better than a leaf held up to the camera.
The noise is anchored to world position rather than to the screen, so a moving branch keeps its verdict instead of sparkling as it passes through a fixed pattern. See
surface.glsl, which does the work.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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
-
values
→ const List<
MaterialAlphaMode> - A constant List of the values in this enum, in order of their declaration.