BoundTexture class final

A texture with the sampler it was bound with.

The pair, not the texture alone, because a texture has no filtering or wrapping of its own — those come from the bind, and the same image is sampled differently by two shaders in the same frame.

The first version of this backend ignored the sampler entirely and always filtered bilinearly with clamped edges, on the strength of a comment saying every sampler the engine binds is clamped. That comment was wrong: SamplerDescriptor.linearRepeat is documented as the default for material textures. It cost about a percent and a half of every textured golden, and it did not look like a sampler bug in the picture — it looked like the checkerboard was very slightly the wrong size.

Constructors

BoundTexture(CpuTexture texture, SamplerDescriptor sampler)
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
height → int
no setter
pixels → Float32List
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sampler → SamplerDescriptor
final
texture → CpuTexture
final
width → int
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sample(double u, double v, {double du = 0.0, double dv = 0.0, double dudx = 0.0, double dvdx = 0.0, double dudy = 0.0, double dvdy = 0.0}) → Vector4
Samples at u, v, choosing a mip level from how fast the coordinate is moving.
sample3D(double u, double v, double w, {double lod = 0.0}) → Vector4
Samples a 3D texture at (u, v, w) and level of detail lod — textureLod(sampler3D, …).
sampleCompare(double u, double v, double reference) → double
A comparison sample — texture(sampler2DShadow, vec3(u, v, reference)): the share of the footprint where reference <compare> stored holds, with the sampler's SamplerDescriptor.compare as the test.
sampleCube(double x, double y, double z, [double lod = 0.0]) → Vector4
Samples a cube in direction, which need not be normalised.
sampleCubeLayer(double x, double y, double z, double layer, [double lod = 0.0]) → Vector4
Samples cube layer of a cube array in direction at level lod — texture(samplerCubeArray, vec4(direction, layer)). See sampleCube.
sampleLayer(double u, double v, double layer, {double du = 0.0, double dv = 0.0}) → Vector4
Samples layer layer of a 2D array at u, v — GLSL's texture(sampler2DArray, vec3(u, v, layer)).
toString() → String
A string representation of this object.
inherited

Operators

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