SolidColorTexture class final
A single flat colour.
A 1x1 white instance stands in for a missing base-colour texture: a shader that declares a sampler must have something bound to it, so "no texture" has to be expressed as a neutral texture rather than an absent binding.
- Inheritance
-
- Object
- ProceduralTexture
- SolidColorTexture
Constructors
- SolidColorTexture(Vector4 color, {int size = 1})
-
const
Properties
- color → Vector4
-
Non-linear (sRGB-encoded) RGBA in the 0..1 range, matching how texture
pixels are authored.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
Edge length in pixels; procedural textures here are square.
final
Methods
-
encode(
) → ByteData -
RGBA8 pixels, row-major from the top-left.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
upload(
GraphicsDevice device) → TextureHandle -
Uploads the pixels through
device.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- flatNormal → SolidColorTexture
-
The neutral tangent-space normal,
(0, 0, 1)encoded into 0..1.no setter - white → SolidColorTexture
-
no setter