ShaderUniformsBuilder class

Fluent builder for assembling ShaderUniforms.

The builder tracks an internal version and increments it only when values actually change.

Available extensions

Constructors

ShaderUniformsBuilder()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addFloat(String name, double value) ShaderUniformsBuilder
Sets one float uniform value.
addFloats(Map<String, UniformValue> properties) ShaderUniformsBuilder

Available on ShaderUniformsBuilder, provided by the ShaderUniformsBuilderImageExtension extension

Adds each UniformValue.value in properties as a float uniform.
addFloatValues(Map<String, double> properties) ShaderUniformsBuilder

Available on ShaderUniformsBuilder, provided by the ShaderUniformsBuilderImageExtension extension

Adds all key/value pairs in properties as float uniforms.
addTexture(String name, Image texture) ShaderUniformsBuilder
Sets one sampler2D uniform image.
addTextures(Map<String, Image> textures) ShaderUniformsBuilder
Merges all texture uniforms and updates version for changed entries.
build() ShaderUniforms
Builds an immutable snapshot of current uniform values.
fromUniforms(ShaderUniforms uniforms) ShaderUniformsBuilder

Available on ShaderUniformsBuilder, provided by the ShaderUniformsBuilderImageExtension extension

Deprecated alias for mergeFromUniforms.
loadTextureAsset(String name, String assetPath) Future<bool>

Available on ShaderUniformsBuilder, provided by the ShaderUniformsBuilderImageExtension extension

Loads an asset image and binds it to name on success.
loadTextureNetwork(String name, String url) Future<bool>

Available on ShaderUniformsBuilder, provided by the ShaderUniformsBuilderImageExtension extension

Loads a network image and binds it to name on success.
mergeFromUniforms(ShaderUniforms uniforms) ShaderUniformsBuilder

Available on ShaderUniformsBuilder, provided by the ShaderUniformsBuilderImageExtension extension

Merges floats and textures from uniforms into this builder.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeFloat(String name) ShaderUniformsBuilder
Removes one float uniform value.
removeTexture(String name) ShaderUniformsBuilder
Removes one sampler2D uniform value.
setCameraOffset(double x, double y) ShaderUniformsBuilder
Sets CommonUniformNames.cameraOffsetX and CommonUniformNames.cameraOffsetY.
setMouse(double x, double y) ShaderUniformsBuilder
Sets CommonUniformNames.iMouseX and CommonUniformNames.iMouseY.
setResolution(double w, double h) ShaderUniformsBuilder
Sets CommonUniformNames.iResolutionX and CommonUniformNames.iResolutionY.
setTime(double? value) ShaderUniformsBuilder
Sets CommonUniformNames.iTime. Null maps to 0.0.
setViewportScale(double scale) ShaderUniformsBuilder
Sets CommonUniformNames.viewportScale.
toString() String
A string representation of this object.
inherited

Operators

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