Interface MutableShaderUniformAccess
- All Superinterfaces:
ShaderUniformAccess,UniformAccess
- All Known Subinterfaces:
ShaderProgram
- All Known Implementing Classes:
ShaderProgramImpl
Provides read and write access to all uniform variables in a shader program.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidApplies theRenderSystemtextures toSampler0-Sampler11.voidaddSampler(CharSequence name, int textureId) Adds a texture that is dynamically bound and sets texture units.default voidSets default uniforms based on whatRenderSystemprovides.default intapplyShaderSamplers(int sampler) Loads the samplers set byaddSampler(CharSequence, int)into the shader.intapplyShaderSamplers(ShaderTextureSource.Context context, int sampler) Loads the samplers set byaddSampler(CharSequence, int)into the shader.voidClears all samplers.voidremoveSampler(CharSequence name) Removes the specified sampler binding.default voidsetFloat(CharSequence name, float value) Sets a float in the shader.default voidsetFloats(CharSequence name, float... values) Sets an array of floats in the shader.default voidsetFramebufferSamplers(AdvancedFbo framebuffer) SetsDiffuseSampler0-DiffuseSamplerMaxto the color buffers in the specified framebuffer.default voidsetInt(CharSequence name, int value) Sets an integer in the shader.default voidsetInts(CharSequence name, int... values) Sets an array of integers in the shader.default voidsetMatrix(CharSequence name, org.joml.Matrix2fc value) Sets a matrix in the shader.default voidsetMatrix(CharSequence name, org.joml.Matrix3fc value) Sets a matrix in the shader.default voidsetMatrix(CharSequence name, org.joml.Matrix3x2fc value) Sets a matrix in the shader.default voidsetMatrix(CharSequence name, org.joml.Matrix4fc value) Sets a matrix in the shader.default voidsetMatrix(CharSequence name, org.joml.Matrix4x3fc value) Sets a matrix in the shader.default voidsetUniformBlock(CharSequence name, int binding) Sets the binding to use for the specified uniform block.default voidsetVector(CharSequence name, float x, float y) Sets a vector in the shader.default voidsetVector(CharSequence name, float x, float y, float z) Sets a vector in the shader.default voidsetVector(CharSequence name, float x, float y, float z, float w) Sets a vector in the shader.default voidsetVectorI(CharSequence name, int x, int y) Sets an integer vector in the shader.default voidsetVectorI(CharSequence name, int x, int y, int z) Sets an integer vector in the shader.default voidsetVectorI(CharSequence name, int x, int y, int z, int w) Sets an integer vector in the shader.default voidsetVectors(CharSequence name, org.joml.Vector2fc... values) Sets an array of vectors in the shader.default voidsetVectors(CharSequence name, org.joml.Vector2ic... values) Sets an array of integer vectors in the shader.default voidsetVectors(CharSequence name, org.joml.Vector3fc... values) Sets an array of vectors in the shader.default voidsetVectors(CharSequence name, org.joml.Vector3ic... values) Sets an array of integer vectors in the shader.default voidsetVectors(CharSequence name, org.joml.Vector4fc... values) Sets an array of vectors in the shader.default voidsetVectors(CharSequence name, org.joml.Vector4ic... values) Sets an array of integer vectors in the shader.Methods inherited from interface foundry.veil.render.shader.program.ShaderUniformAccess
getFloat, getFloats, getInt, getInts, getMatrix, getMatrix, getMatrix, getMatrix, getMatrix, getProgram, getUniform, getUniformBlock, getVector, getVector, getVector, getVector, getVector, getVectorMethods inherited from interface foundry.veil.render.shader.program.UniformAccess
setVector, setVector, setVector, setVectorI, setVectorI, setVectorI
-
Method Details
-
applyRenderSystem
default void applyRenderSystem()Sets default uniforms based on whatRenderSystemprovides. -
addRenderSystemTextures
default void addRenderSystemTextures()Applies theRenderSystemtextures toSampler0-Sampler11. -
setFramebufferSamplers
SetsDiffuseSampler0-DiffuseSamplerMaxto the color buffers in the specified framebuffer.- Parameters:
framebuffer- The framebuffer to bind samplers from
-
addSampler
Adds a texture that is dynamically bound and sets texture units.- Parameters:
name- The name of the texture to settextureId- The id of the texture to bind and assign a texture unit
-
removeSampler
Removes the specified sampler binding.- Parameters:
name- The name of the sampler to remove
-
applyShaderSamplers
default int applyShaderSamplers(int sampler) Loads the samplers set byaddSampler(CharSequence, int)into the shader.- Parameters:
sampler- The sampler to start binding to- Returns:
- The next available sampler
-
applyShaderSamplers
Loads the samplers set byaddSampler(CharSequence, int)into the shader.- Parameters:
context- The context for setting built-in shader samplers ornullto ignore normal samplerssampler- The sampler to start binding to- Returns:
- The next available sampler
-
clearSamplers
void clearSamplers()Clears all samplers. -
setUniformBlock
Description copied from interface:UniformAccessSets the binding to use for the specified uniform block.- Specified by:
setUniformBlockin interfaceUniformAccess- Parameters:
name- The name of the block to setbinding- The binding to use for that block
-
setFloat
Description copied from interface:UniformAccessSets a float in the shader.- Specified by:
setFloatin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalue- The value to set
-
setVector
Description copied from interface:UniformAccessSets a vector in the shader.- Specified by:
setVectorin interfaceUniformAccess- Parameters:
name- The name of the uniform to setx- The x component of the vectory- The y component of the vector
-
setVector
Description copied from interface:UniformAccessSets a vector in the shader.- Specified by:
setVectorin interfaceUniformAccess- Parameters:
name- The name of the uniform to setx- The x component of the vectory- The y component of the vectorz- The z component of the vector
-
setVector
Description copied from interface:UniformAccessSets a vector in the shader.- Specified by:
setVectorin interfaceUniformAccess- Parameters:
name- The name of the uniform to setx- 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
Description copied from interface:UniformAccessSets an integer in the shader.- Specified by:
setIntin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalue- The value to set
-
setVectorI
Description copied from interface:UniformAccessSets an integer vector in the shader.- Specified by:
setVectorIin interfaceUniformAccess- Parameters:
name- The name of the uniform to setx- The x component of the vectory- The y component of the vector
-
setVectorI
Description copied from interface:UniformAccessSets an integer vector in the shader.- Specified by:
setVectorIin interfaceUniformAccess- Parameters:
name- The name of the uniform to setx- The x component of the vectory- The y component of the vectorz- The z component of the vector
-
setVectorI
Description copied from interface:UniformAccessSets an integer vector in the shader.- Specified by:
setVectorIin interfaceUniformAccess- Parameters:
name- The name of the uniform to setx- 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
Description copied from interface:UniformAccessSets an array of floats in the shader.- Specified by:
setFloatsin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalues- The values to set in order
-
setVectors
Description copied from interface:UniformAccessSets an array of vectors in the shader.- Specified by:
setVectorsin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalues- The values to set in order
-
setVectors
Description copied from interface:UniformAccessSets an array of vectors in the shader.- Specified by:
setVectorsin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalues- The values to set in order
-
setVectors
Description copied from interface:UniformAccessSets an array of vectors in the shader.- Specified by:
setVectorsin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalues- The values to set in order
-
setInts
Description copied from interface:UniformAccessSets an array of integers in the shader.- Specified by:
setIntsin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalues- The values to set in order
-
setVectors
Description copied from interface:UniformAccessSets an array of integer vectors in the shader.- Specified by:
setVectorsin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalues- The values to set in order
-
setVectors
Description copied from interface:UniformAccessSets an array of integer vectors in the shader.- Specified by:
setVectorsin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalues- The values to set in order
-
setVectors
Description copied from interface:UniformAccessSets an array of integer vectors in the shader.- Specified by:
setVectorsin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalues- The values to set in order
-
setMatrix
Description copied from interface:UniformAccessSets a matrix in the shader.- Specified by:
setMatrixin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalue- The value to set
-
setMatrix
Description copied from interface:UniformAccessSets a matrix in the shader.- Specified by:
setMatrixin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalue- The value to set
-
setMatrix
Description copied from interface:UniformAccessSets a matrix in the shader.- Specified by:
setMatrixin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalue- The value to set
-
setMatrix
Description copied from interface:UniformAccessSets a matrix in the shader.- Specified by:
setMatrixin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalue- The value to set
-
setMatrix
Description copied from interface:UniformAccessSets a matrix in the shader.- Specified by:
setMatrixin interfaceUniformAccess- Parameters:
name- The name of the uniform to setvalue- The value to set
-