Interface ShaderUniform
- All Superinterfaces:
ShaderUniformAccess
- All Known Implementing Classes:
ShaderUniformImpl
A single uniform in a shader program.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Possible uniform types that can be used. -
Field Summary
Fields inherited from interface foundry.veil.api.client.render.shader.uniform.ShaderUniformAccess
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptionint
double
Retrieves the value of this uniform as a double.default double[]
Retrieves the values of this uniform as a double array.default void
getDoubles
(double[] fill) Retrieves the values of this uniform as a double array and stores them in the specified array.void
getDoubles
(double[] dst, int offset, int length) Retrieves the values of this uniform as a double array and stores them in the specified array.float
getFloat()
Retrieves the value of this uniform as a float.default float[]
Retrieves the values of this uniform as a float array.default void
getFloats
(float[] fill) Retrieves the values of this uniform as a float array and stores them in the specified array.void
getFloats
(float[] dst, int offset, int length) Retrieves the values of this uniform as a float array and stores them in the specified array.int
getInt()
Retrieves the value of this uniform as an integer.default int[]
getInts()
Retrieves the values of this uniform as an int array.default void
getInts
(int[] fill) Retrieves the values of this uniform as an int array and stores them in the specified array.void
getInts
(int[] dst, int offset, int length) Retrieves the values of this uniform as an int array and stores them in the specified array.int
long
getLong()
Retrieves the value of this uniform as a long.default long[]
getLongs()
Retrieves the values of this uniform as a long array.default void
getLongs
(long[] fill) Retrieves the values of this uniform as a long array and stores them in the specified array.void
getLongs
(long[] dst, int offset, int length) Retrieves the values of this uniform as a long array and stores them in the specified array.void
getMatrix
(CharSequence name, org.joml.Matrix2f value) Retrieves a matrix2x2 by the specified namevoid
getMatrix
(CharSequence name, org.joml.Matrix3f value) Retrieves a matrix3x3 by the specified namevoid
getMatrix
(CharSequence name, org.joml.Matrix3x2f value) Retrieves a matrix3x2 by the specified namevoid
getMatrix
(CharSequence name, org.joml.Matrix4f value) Retrieves a matrix4x4 by the specified namevoid
getMatrix
(CharSequence name, org.joml.Matrix4x3f value) Retrieves a matrix4x3 by the specified namegetName()
getType()
void
getVector
(CharSequence name, org.joml.Vector2f... values) Retrieves an array of vectors by the specified name.void
getVector
(CharSequence name, org.joml.Vector3f... values) Retrieves an array of vectors by the specified name.void
getVector
(CharSequence name, org.joml.Vector4f... values) Retrieves an array of vectors by the specified name.void
getVectori
(CharSequence name, org.joml.Vector2i... values) Retrieves an array of vectors by the specified name.void
getVectori
(CharSequence name, org.joml.Vector3i... values) Retrieves an array of vectors by the specified name.void
getVectori
(CharSequence name, org.joml.Vector4i... values) Retrieves an array of vectors by the specified name.void
Invalidates the uniform cache.default boolean
isValid()
Methods inherited from interface foundry.veil.api.client.render.shader.uniform.ShaderUniformAccess
set64Vectors, set64Vectors, set64Vectors, setDouble, setDoubles, setFloat, setFloats, setInt, setInts, setIVectors, setIVectors, setIVectors, setLong, setLongs, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix2x3, setMatrix2x3, setMatrix2x3, setMatrix2x3, setMatrix3x2, setMatrix3x2, setMatrix3x2, setMatrix3x2, setMatrix3x4, setMatrix3x4, setMatrix3x4, setMatrix3x4, setMatrix4x3, setMatrix4x3, setMatrix4x3, setMatrix4x3, setVector, setVector, setVector, setVector, setVector, setVector, setVector, setVector64, setVector64, setVector64, setVector64, setVector64, setVector64, setVector64, setVectorI, setVectorI, setVectorI, setVectorI, setVectorI, setVectorI, setVectorI, setVectorI64, setVectorI64, setVectorI64, setVectorI64, setVectors, setVectors, setVectors
-
Method Details
-
invalidateCache
void invalidateCache()Invalidates the uniform cache. -
isValid
default boolean isValid()- Specified by:
isValid
in interfaceShaderUniformAccess
- Returns:
- Whether this uniform is valid
-
getName
String getName()- Returns:
- The name assigned to this uniform in the shader
-
getLocation
int getLocation()- Returns:
- The location of the uniform in the shader
-
getType
ShaderUniform.Type getType()- Returns:
- The data type of this uniform in the shader
-
getArrayLength
int getArrayLength()- Returns:
- The number of array elements in the uniform
-
getFloat
float getFloat()Retrieves the value of this uniform as a float.- Returns:
- The float value of this uniform
-
getFloats
default float[] getFloats()Retrieves the values of this uniform as a float array.- Returns:
- A new array with the values of this uniform
-
getFloats
default void getFloats(float[] fill) Retrieves the values of this uniform as a float array and stores them in the specified array.- Parameters:
fill
- The array to fill
-
getFloats
void getFloats(float[] dst, int offset, int length) Retrieves the values of this uniform as a float array and stores them in the specified array.- Parameters:
dst
- The array to filloffset
- The position to start filling the array atlength
- The number of values to read
-
getInt
int getInt()Retrieves the value of this uniform as an integer.- Returns:
- The int value of this uniform
-
getInts
default int[] getInts()Retrieves the values of this uniform as an int array.- Returns:
- A new array with the values of this uniform
-
getInts
default void getInts(int[] fill) Retrieves the values of this uniform as an int array and stores them in the specified array.- Parameters:
fill
- The array to fill
-
getInts
void getInts(int[] dst, int offset, int length) Retrieves the values of this uniform as an int array and stores them in the specified array.- Parameters:
dst
- The array to filloffset
- The position to start filling the array atlength
- The number of values to read
-
getDouble
double getDouble()Retrieves the value of this uniform as a double.- Returns:
- The int value of this uniform
-
getDoubles
default double[] getDoubles()Retrieves the values of this uniform as a double array.- Returns:
- A new array with the values of this uniform
-
getDoubles
default void getDoubles(double[] fill) Retrieves the values of this uniform as a double array and stores them in the specified array.- Parameters:
fill
- The array to fill
-
getDoubles
void getDoubles(double[] dst, int offset, int length) Retrieves the values of this uniform as a double array and stores them in the specified array.- Parameters:
dst
- The array to filloffset
- The position to start filling the array atlength
- The number of values to read
-
getLong
long getLong()Retrieves the value of this uniform as a long.- Returns:
- The int value of this uniform
-
getLongs
default long[] getLongs()Retrieves the values of this uniform as a long array.- Returns:
- A new array with the values of this uniform
-
getLongs
default void getLongs(long[] fill) Retrieves the values of this uniform as a long array and stores them in the specified array.- Parameters:
fill
- The array to fill
-
getLongs
void getLongs(long[] dst, int offset, int length) Retrieves the values of this uniform as a long array and stores them in the specified array.- Parameters:
dst
- The array to filloffset
- The position to start filling the array atlength
- The number of values to read
-
getVector
Retrieves an array of vectors by the specified name.- Parameters:
name
- The name of the uniform to getvalues
- The values to set
-
getVector
Retrieves an array of vectors by the specified name.- Parameters:
name
- The name of the uniform to getvalues
- The values to set
-
getVector
Retrieves an array of vectors by the specified name.- Parameters:
name
- The name of the uniform to getvalues
- The values to set
-
getVectori
Retrieves an array of vectors by the specified name.- Parameters:
name
- The name of the uniform to getvalues
- The values to set
-
getVectori
Retrieves an array of vectors by the specified name.- Parameters:
name
- The name of the uniform to getvalues
- The values to set
-
getVectori
Retrieves an array of vectors by the specified name.- Parameters:
name
- The name of the uniform to getvalues
- The values to set
-
getMatrix
Retrieves a matrix2x2 by the specified name- Parameters:
name
- The name of the uniform to getvalue
- The value to set
-
getMatrix
Retrieves a matrix3x3 by the specified name- Parameters:
name
- The name of the uniform to getvalue
- The value to set
-
getMatrix
Retrieves a matrix4x4 by the specified name- Parameters:
name
- The name of the uniform to getvalue
- The value to set
-
getMatrix
Retrieves a matrix3x2 by the specified name- Parameters:
name
- The name of the uniform to getvalue
- The value to set
-
getMatrix
Retrieves a matrix4x3 by the specified name- Parameters:
name
- The name of the uniform to getvalue
- The value to set
-