Class ShaderUniformImpl
java.lang.Object
foundry.veil.impl.client.render.shader.uniform.ShaderUniformImpl
- All Implemented Interfaces:
ShaderUniform,ShaderUniformAccess,AutoCloseable,org.lwjgl.system.NativeResource
@Internal
public class ShaderUniformImpl
extends Object
implements ShaderUniform, org.lwjgl.system.NativeResource
-
Nested Class Summary
Nested classes/interfaces inherited from interface foundry.veil.api.client.render.shader.uniform.ShaderUniform
ShaderUniform.Type -
Field Summary
Fields inherited from interface foundry.veil.api.client.render.shader.uniform.ShaderUniformAccess
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfree()intdoubleRetrieves the value of this uniform as a double.voidgetDoubles(double[] dst, int offset, int length) Retrieves the values of this uniform as a double array and stores them in the specified array.floatgetFloat()Retrieves the value of this uniform as a float.voidgetFloats(float[] dst, int offset, int length) Retrieves the values of this uniform as a float array and stores them in the specified array.intgetInt()Retrieves the value of this uniform as an integer.voidgetInts(int[] dst, int offset, int length) Retrieves the values of this uniform as an int array and stores them in the specified array.intlonggetLong()Retrieves the value of this uniform as a long.voidgetLongs(long[] dst, int offset, int length) Retrieves the values of this uniform as a long array and stores them in the specified array.voidgetMatrix(CharSequence name, org.joml.Matrix2f value) Retrieves a matrix2x2 by the specified namevoidgetMatrix(CharSequence name, org.joml.Matrix3f value) Retrieves a matrix3x3 by the specified namevoidgetMatrix(CharSequence name, org.joml.Matrix3x2f value) Retrieves a matrix3x2 by the specified namevoidgetMatrix(CharSequence name, org.joml.Matrix4f value) Retrieves a matrix4x4 by the specified namevoidgetMatrix(CharSequence name, org.joml.Matrix4x3f value) Retrieves a matrix4x3 by the specified namegetName()getType()voidgetVector(CharSequence name, org.joml.Vector2f... values) Retrieves an array of vectors by the specified name.voidgetVector(CharSequence name, org.joml.Vector3f... values) Retrieves an array of vectors by the specified name.voidgetVector(CharSequence name, org.joml.Vector4f... values) Retrieves an array of vectors by the specified name.voidgetVectori(CharSequence name, org.joml.Vector2i... values) Retrieves an array of vectors by the specified name.voidgetVectori(CharSequence name, org.joml.Vector3i... values) Retrieves an array of vectors by the specified name.voidgetVectori(CharSequence name, org.joml.Vector4i... values) Retrieves an array of vectors by the specified name.voidInvalidates the uniform cache.voidset(ShaderUniformCache.Uniform uniform) voidset64Vectors(org.joml.Vector2dc... values) Sets an array of double vectors in the shader.voidset64Vectors(org.joml.Vector3dc... values) Sets an array of double vectors in the shader.voidset64Vectors(org.joml.Vector4dc... values) Sets an array of double vectors in the shader.voidsetDouble(double value) Sets a double in the shader.voidsetDoubles(double... values) Sets an array of doubles in the shader.voidsetFloat(float value) Sets a float in the shader.voidsetFloats(float... values) Sets an array of floats in the shader.voidsetHandle(long value) Uploads this uniform as a handle type.voidsetHandles(long... values) Uploads this uniform as a handle type.voidsetInt(int value) Sets an integer in the shader.voidsetInts(int... values) Sets an array of integers in the shader.voidsetIVectors(org.joml.Vector2ic... values) Sets an array of integer vectors in the shader.voidsetIVectors(org.joml.Vector3ic... values) Sets an array of integer vectors in the shader.voidsetIVectors(org.joml.Vector4ic... values) Sets an array of integer vectors in the shader.voidsetLong(long value) Sets a long in the shader.voidsetLongs(long... values) Sets an array of longs in the shader.voidsetMatrix(org.joml.Matrix2dc value, boolean transpose) Sets a double matrix in the shader.voidsetMatrix(org.joml.Matrix2fc value, boolean transpose) Sets a matrix in the shader.voidsetMatrix(org.joml.Matrix3dc value, boolean transpose) Sets a double matrix in the shader.voidsetMatrix(org.joml.Matrix3fc value, boolean transpose) Sets a matrix in the shader.voidsetMatrix(org.joml.Matrix4dc value, boolean transpose) Sets a double matrix in the shader.voidsetMatrix(org.joml.Matrix4fc value, boolean transpose) Sets a matrix in the shader.voidsetMatrix2x3(org.joml.Matrix3x2dc value, boolean transpose) Sets a double matrix in the shader.voidsetMatrix2x3(org.joml.Matrix3x2fc value, boolean transpose) Sets a matrix in the shader.voidsetMatrix3x2(org.joml.Matrix3x2dc value, boolean transpose) Sets a double matrix in the shader.voidsetMatrix3x2(org.joml.Matrix3x2fc value, boolean transpose) Sets a matrix in the shader.voidsetMatrix3x4(org.joml.Matrix4x3dc value, boolean transpose) Sets a double matrix in the shader.voidsetMatrix3x4(org.joml.Matrix4x3fc value, boolean transpose) Sets a matrix in the shader.voidsetMatrix4x3(org.joml.Matrix4x3dc value, boolean transpose) Sets a double matrix in the shader.voidsetMatrix4x3(org.joml.Matrix4x3fc value, boolean transpose) Sets a matrix in the shader.voidsetVector(float x, float y) Sets a vector in the shader.voidsetVector(float x, float y, float z) Sets a vector in the shader.voidsetVector(float x, float y, float z, float w) Sets a vector in the shader.voidsetVector64(double x, double y) Sets a double vector in the shader.voidsetVector64(double x, double y, double z) Sets a double vector in the shader.voidsetVector64(double x, double y, double z, double w) Sets a double vector in the shader.voidsetVectorI(int x, int y) Sets an integer vector in the shader.voidsetVectorI(int x, int y, int z) Sets an integer vector in the shader.voidsetVectorI(int x, int y, int z, int w) Sets an integer vector in the shader.voidsetVectorI64(long x, long y) Sets a long vector in the shader.voidsetVectorI64(long x, long y, long z) Sets a long vector in the shader.voidsetVectorI64(long x, long y, long z, long w) Sets a long vector in the shader.voidsetVectors(org.joml.Vector2fc... values) Sets an array of vectors in the shader.voidsetVectors(org.joml.Vector3fc... values) Sets an array of vectors in the shader.voidsetVectors(org.joml.Vector4fc... values) Sets an array of vectors in the shader.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lwjgl.system.NativeResource
closeMethods inherited from interface foundry.veil.api.client.render.shader.uniform.ShaderUniform
getDoubles, getDoubles, getFloats, getFloats, getInts, getInts, getLongs, getLongs, isValidMethods inherited from interface foundry.veil.api.client.render.shader.uniform.ShaderUniformAccess
setMatrix, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix, setMatrix2x3, setMatrix2x3, setMatrix3x2, setMatrix3x2, setMatrix3x4, setMatrix3x4, setMatrix4x3, setMatrix4x3, setVector, setVector, setVector, setVector, setVector64, setVector64, setVector64, setVector64, setVectorI, setVectorI, setVectorI, setVectorI, setVectorI64
-
Constructor Details
-
ShaderUniformImpl
-
-
Method Details
-
set
-
invalidateCache
public void invalidateCache()Description copied from interface:ShaderUniformInvalidates the uniform cache.- Specified by:
invalidateCachein interfaceShaderUniform
-
getName
- Specified by:
getNamein interfaceShaderUniform- Returns:
- The name assigned to this uniform in the shader
-
getLocation
public int getLocation()- Specified by:
getLocationin interfaceShaderUniform- Returns:
- The location of the uniform in the shader
-
getType
- Specified by:
getTypein interfaceShaderUniform- Returns:
- The data type of this uniform in the shader
-
getArrayLength
public int getArrayLength()- Specified by:
getArrayLengthin interfaceShaderUniform- Returns:
- The number of array elements in the uniform
-
getFloat
public float getFloat()Description copied from interface:ShaderUniformRetrieves the value of this uniform as a float.- Specified by:
getFloatin interfaceShaderUniform- Returns:
- The float value of this uniform
-
getFloats
public void getFloats(float[] dst, int offset, int length) Description copied from interface:ShaderUniformRetrieves the values of this uniform as a float array and stores them in the specified array.- Specified by:
getFloatsin interfaceShaderUniform- Parameters:
dst- The array to filloffset- The position to start filling the array atlength- The number of values to read
-
getInt
public int getInt()Description copied from interface:ShaderUniformRetrieves the value of this uniform as an integer.- Specified by:
getIntin interfaceShaderUniform- Returns:
- The int value of this uniform
-
getInts
public void getInts(int[] dst, int offset, int length) Description copied from interface:ShaderUniformRetrieves the values of this uniform as an int array and stores them in the specified array.- Specified by:
getIntsin interfaceShaderUniform- Parameters:
dst- The array to filloffset- The position to start filling the array atlength- The number of values to read
-
getDouble
public double getDouble()Description copied from interface:ShaderUniformRetrieves the value of this uniform as a double.- Specified by:
getDoublein interfaceShaderUniform- Returns:
- The int value of this uniform
-
getDoubles
public void getDoubles(double[] dst, int offset, int length) Description copied from interface:ShaderUniformRetrieves the values of this uniform as a double array and stores them in the specified array.- Specified by:
getDoublesin interfaceShaderUniform- Parameters:
dst- The array to filloffset- The position to start filling the array atlength- The number of values to read
-
getLong
public long getLong()Description copied from interface:ShaderUniformRetrieves the value of this uniform as a long.- Specified by:
getLongin interfaceShaderUniform- Returns:
- The int value of this uniform
-
getLongs
public void getLongs(long[] dst, int offset, int length) Description copied from interface:ShaderUniformRetrieves the values of this uniform as a long array and stores them in the specified array.- Specified by:
getLongsin interfaceShaderUniform- Parameters:
dst- The array to filloffset- The position to start filling the array atlength- The number of values to read
-
getVector
Description copied from interface:ShaderUniformRetrieves an array of vectors by the specified name.- Specified by:
getVectorin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalues- The values to set
-
getVector
Description copied from interface:ShaderUniformRetrieves an array of vectors by the specified name.- Specified by:
getVectorin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalues- The values to set
-
getVector
Description copied from interface:ShaderUniformRetrieves an array of vectors by the specified name.- Specified by:
getVectorin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalues- The values to set
-
getVectori
Description copied from interface:ShaderUniformRetrieves an array of vectors by the specified name.- Specified by:
getVectoriin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalues- The values to set
-
getVectori
Description copied from interface:ShaderUniformRetrieves an array of vectors by the specified name.- Specified by:
getVectoriin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalues- The values to set
-
getVectori
Description copied from interface:ShaderUniformRetrieves an array of vectors by the specified name.- Specified by:
getVectoriin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalues- The values to set
-
getMatrix
Description copied from interface:ShaderUniformRetrieves a matrix2x2 by the specified name- Specified by:
getMatrixin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalue- The value to set
-
getMatrix
Description copied from interface:ShaderUniformRetrieves a matrix3x3 by the specified name- Specified by:
getMatrixin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalue- The value to set
-
getMatrix
Description copied from interface:ShaderUniformRetrieves a matrix4x4 by the specified name- Specified by:
getMatrixin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalue- The value to set
-
getMatrix
Description copied from interface:ShaderUniformRetrieves a matrix3x2 by the specified name- Specified by:
getMatrixin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalue- The value to set
-
getMatrix
Description copied from interface:ShaderUniformRetrieves a matrix4x3 by the specified name- Specified by:
getMatrixin interfaceShaderUniform- Parameters:
name- The name of the uniform to getvalue- The value to set
-
free
public void free()- Specified by:
freein interfaceorg.lwjgl.system.NativeResource
-
setFloat
public void setFloat(float value) Description copied from interface:ShaderUniformAccessSets a float in the shader.- Specified by:
setFloatin interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setVector
public void setVector(float x, float y) Description copied from interface:ShaderUniformAccessSets a vector in the shader.- Specified by:
setVectorin interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vector
-
setVector
public void setVector(float x, float y, float z) Description copied from interface:ShaderUniformAccessSets a vector in the shader.- Specified by:
setVectorin interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vectorz- The z component of the vector
-
setVector
public void setVector(float x, float y, float z, float w) Description copied from interface:ShaderUniformAccessSets a vector in the shader.- Specified by:
setVectorin interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vectorz- The z component of the vectorw- The w component of the vector
-
setInt
public void setInt(int value) Description copied from interface:ShaderUniformAccessSets an integer in the shader.- Specified by:
setIntin interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setVectorI
public void setVectorI(int x, int y) Description copied from interface:ShaderUniformAccessSets an integer vector in the shader.- Specified by:
setVectorIin interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vector
-
setVectorI
public void setVectorI(int x, int y, int z) Description copied from interface:ShaderUniformAccessSets an integer vector in the shader.- Specified by:
setVectorIin interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vectorz- The z component of the vector
-
setVectorI
public void setVectorI(int x, int y, int z, int w) Description copied from interface:ShaderUniformAccessSets an integer vector in the shader.- Specified by:
setVectorIin interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vectorz- The z component of the vectorw- The w component of the vector
-
setDouble
public void setDouble(double value) Description copied from interface:ShaderUniformAccessSets a double in the shader.- Specified by:
setDoublein interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setVector64
public void setVector64(double x, double y) Description copied from interface:ShaderUniformAccessSets a double vector in the shader.- Specified by:
setVector64in interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vector
-
setVector64
public void setVector64(double x, double y, double z) Description copied from interface:ShaderUniformAccessSets a double vector in the shader.- Specified by:
setVector64in interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vectorz- The z component of the vector
-
setVector64
public void setVector64(double x, double y, double z, double w) Description copied from interface:ShaderUniformAccessSets a double vector in the shader.- Specified by:
setVector64in interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vectorz- The z component of the vectorw- The w component of the vector
-
setLong
public void setLong(long value) Description copied from interface:ShaderUniformAccessSets a long in the shader.- Specified by:
setLongin interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setVectorI64
public void setVectorI64(long x, long y) Description copied from interface:ShaderUniformAccessSets a long vector in the shader.- Specified by:
setVectorI64in interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vector
-
setVectorI64
public void setVectorI64(long x, long y, long z) Description copied from interface:ShaderUniformAccessSets a long vector in the shader.- Specified by:
setVectorI64in interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vectorz- The z component of the vector
-
setVectorI64
public void setVectorI64(long x, long y, long z, long w) Description copied from interface:ShaderUniformAccessSets a long vector in the shader.- Specified by:
setVectorI64in interfaceShaderUniformAccess- Parameters:
x- The x component of the vectory- The y component of the vectorz- The z component of the vectorw- The w component of the vector
-
setFloats
public void setFloats(float... values) Description copied from interface:ShaderUniformAccessSets an array of floats in the shader.- Specified by:
setFloatsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
setVectors
public void setVectors(org.joml.Vector2fc... values) Description copied from interface:ShaderUniformAccessSets an array of vectors in the shader.- Specified by:
setVectorsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
setVectors
public void setVectors(org.joml.Vector3fc... values) Description copied from interface:ShaderUniformAccessSets an array of vectors in the shader.- Specified by:
setVectorsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
setVectors
public void setVectors(org.joml.Vector4fc... values) Description copied from interface:ShaderUniformAccessSets an array of vectors in the shader.- Specified by:
setVectorsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
setInts
public void setInts(int... values) Description copied from interface:ShaderUniformAccessSets an array of integers in the shader.- Specified by:
setIntsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
setIVectors
public void setIVectors(org.joml.Vector2ic... values) Description copied from interface:ShaderUniformAccessSets an array of integer vectors in the shader.- Specified by:
setIVectorsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
setIVectors
public void setIVectors(org.joml.Vector3ic... values) Description copied from interface:ShaderUniformAccessSets an array of integer vectors in the shader.- Specified by:
setIVectorsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
setIVectors
public void setIVectors(org.joml.Vector4ic... values) Description copied from interface:ShaderUniformAccessSets an array of integer vectors in the shader.- Specified by:
setIVectorsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
setDoubles
public void setDoubles(double... values) Description copied from interface:ShaderUniformAccessSets an array of doubles in the shader.- Specified by:
setDoublesin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
set64Vectors
public void set64Vectors(org.joml.Vector2dc... values) Description copied from interface:ShaderUniformAccessSets an array of double vectors in the shader.- Specified by:
set64Vectorsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
set64Vectors
public void set64Vectors(org.joml.Vector3dc... values) Description copied from interface:ShaderUniformAccessSets an array of double vectors in the shader.- Specified by:
set64Vectorsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
set64Vectors
public void set64Vectors(org.joml.Vector4dc... values) Description copied from interface:ShaderUniformAccessSets an array of double vectors in the shader.- Specified by:
set64Vectorsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
setLongs
public void setLongs(long... values) Description copied from interface:ShaderUniformAccessSets an array of longs in the shader.- Specified by:
setLongsin interfaceShaderUniformAccess- Parameters:
values- The values to set in order
-
setHandle
public void setHandle(long value) Description copied from interface:ShaderUniformAccessUploads this uniform as a handle type. Only supported if bindless texture is supported.- Specified by:
setHandlein interfaceShaderUniformAccess- Parameters:
value- The handle to upload
-
setHandles
public void setHandles(long... values) Description copied from interface:ShaderUniformAccessUploads this uniform as a handle type. Only supported if bindless texture is supported.- Specified by:
setHandlesin interfaceShaderUniformAccess- Parameters:
values- The handles to upload
-
setMatrix
public void setMatrix(org.joml.Matrix2fc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a matrix in the shader.- Specified by:
setMatrixin interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix
public void setMatrix(org.joml.Matrix3fc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a matrix in the shader.- Specified by:
setMatrixin interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix
public void setMatrix(org.joml.Matrix4fc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a matrix in the shader.- Specified by:
setMatrixin interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix2x3
public void setMatrix2x3(org.joml.Matrix3x2fc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a matrix in the shader.- Specified by:
setMatrix2x3in interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix3x2
public void setMatrix3x2(org.joml.Matrix3x2fc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a matrix in the shader.- Specified by:
setMatrix3x2in interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix3x4
public void setMatrix3x4(org.joml.Matrix4x3fc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a matrix in the shader.- Specified by:
setMatrix3x4in interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix4x3
public void setMatrix4x3(org.joml.Matrix4x3fc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a matrix in the shader.- Specified by:
setMatrix4x3in interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix
public void setMatrix(org.joml.Matrix2dc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a double matrix in the shader.- Specified by:
setMatrixin interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix
public void setMatrix(org.joml.Matrix3dc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a double matrix in the shader.- Specified by:
setMatrixin interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix
public void setMatrix(org.joml.Matrix4dc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a double matrix in the shader.- Specified by:
setMatrixin interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix2x3
public void setMatrix2x3(org.joml.Matrix3x2dc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a double matrix in the shader.- Specified by:
setMatrix2x3in interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix3x2
public void setMatrix3x2(org.joml.Matrix3x2dc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a double matrix in the shader.- Specified by:
setMatrix3x2in interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix3x4
public void setMatrix3x4(org.joml.Matrix4x3dc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a double matrix in the shader.- Specified by:
setMatrix3x4in interfaceShaderUniformAccess- Parameters:
value- The value to set
-
setMatrix4x3
public void setMatrix4x3(org.joml.Matrix4x3dc value, boolean transpose) Description copied from interface:ShaderUniformAccessSets a double matrix in the shader.- Specified by:
setMatrix4x3in interfaceShaderUniformAccess- Parameters:
value- The value to set
-