DataTextureFormat enum Assets and loading

The texel formats a data texture (Texture2D.fromData, Texture2DArray) can hold.

These are the uncompressed sampleable formats every backend allocates. There is no single-channel 16-bit format yet; store 16-bit data as rg8 with the high byte in red, so a filtered r * 255.0 * 256.0 + g * 255.0 is still the filtered value, or as r32Float.

Inheritance
Available extensions

Values

r8 → const DataTextureFormat

One 8-bit unsigned normalized channel.

const DataTextureFormat(gpu.PixelFormat.r8UNormInt, 1)
rg8 → const DataTextureFormat

Two 8-bit unsigned normalized channels.

const DataTextureFormat(gpu.PixelFormat.r8g8UNormInt, 2)
rgba8 → const DataTextureFormat

Four 8-bit unsigned normalized channels.

const DataTextureFormat(gpu.PixelFormat.r8g8b8a8UNormInt, 4)
r32Float → const DataTextureFormat

One 32-bit float channel. Samples with nearest filtering by default, since not every device filters 32-bit floats.

const DataTextureFormat(gpu.PixelFormat.r32Float, 4)
rgba16Float → const DataTextureFormat

Four 16-bit float channels.

const DataTextureFormat(gpu.PixelFormat.r16g16b16a16Float, 8)
rgba32Float → const DataTextureFormat

Four 32-bit float channels. Samples with nearest filtering by default, since not every device filters 32-bit floats.

const DataTextureFormat(gpu.PixelFormat.r32g32b32a32Float, 16)

Properties

bytesPerTexel → int
The bytes one texel occupies.
final
defaultSampling → TextureSampling
The sampling a data texture of this format gets when none is given: TextureSampling.data, with nearest filtering for the 32-bit float formats. Linear filtering of those needs device support (missing on older iOS GPUs and on WebGL2 without OES_texture_float_linear), where it samples black or fails, so it is opt in.
no setter
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<DataTextureFormat>
A constant List of the values in this enum, in order of their declaration.