Interface EffectUniform
public interface EffectUniform
One named uniform of a screen effect, written into every pass that declares it.
Until it's given a value, a uniform keeps the default its effect definition declares. Its value comes from, in order of precedence: a binding, a running animation, then the last value set. Values are converted to the declared type: floats are truncated into int uniforms, and missing components are 0.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptiondefault EffectUniformanimateTo(int ticks, float... target) Moves the value from where it is now totargetoverticksticks of real time (20 per second).bind(EffectUniform.FloatBinding binding) Computes a float value every frame, overriding set and animated values untilunbind().bind(EffectUniform.VectorBinding binding) Computes a vector value every frame, overriding set and animated values untilunbind().floatget()The current first component: the definition's default if never set, 0 before the effect has loaded.float[]getAll()The current components, as floats: the definition's default if never set, empty before the effect has loaded.name()reset()Drops the binding, animation and set value: the definition's default applies again.set(float... values) Sets a float, vec2, vec3 or vec4 (or a 4x4 matrix from 16 column-major floats).default EffectUniformset(org.joml.Matrix4fc value) default EffectUniformset(org.joml.Vector2fc value) default EffectUniformset(org.joml.Vector3fc value) default EffectUniformset(org.joml.Vector4fc value) default EffectUniformsetColor(int argb) Sets an RGBA color from a packed ARGB int, as a vec4.setInt(int... values) Sets an int or ivec3.unbind()
-
Method Details
-
name
String name() -
set
Sets a float, vec2, vec3 or vec4 (or a 4x4 matrix from 16 column-major floats). Stops any animation. -
setInt
Sets an int or ivec3. Stops any animation. -
set
-
set
-
set
-
set
-
setColor
Sets an RGBA color from a packed ARGB int, as a vec4. -
animateTo
Moves the value from where it is now totargetoverticksticks of real time (20 per second). -
animateTo
-
bind
Computes a float value every frame, overriding set and animated values untilunbind(). -
bind
Computes a vector value every frame, overriding set and animated values untilunbind(). -
unbind
EffectUniform unbind() -
reset
EffectUniform reset()Drops the binding, animation and set value: the definition's default applies again. -
get
float get()The current first component: the definition's default if never set, 0 before the effect has loaded. -
getAll
float[] getAll()The current components, as floats: the definition's default if never set, empty before the effect has loaded.
-