setTexture method

void setTexture(
  1. String name,
  2. Texture? texture, {
  3. SamplerOptions? sampler,
})

Assign a texture to a sampler uniform by name.

Pass null for texture to clear the binding.

Implementation

void setTexture(
  String name,
  gpu.Texture? texture, {
  gpu.SamplerOptions? sampler,
}) {
  if (texture == null) {
    _textures.remove(name);
  } else {
    _textures[name] = _BoundTexture(texture, sampler);
  }
}