Interface MutableShaderUniformAccess

All Superinterfaces:
ShaderUniformAccess, UniformAccess
All Known Subinterfaces:
ShaderProgram
All Known Implementing Classes:
ShaderProgramImpl

public interface MutableShaderUniformAccess extends UniformAccess, ShaderUniformAccess
Provides read and write access to all uniform variables in a shader program.
  • Method Details

    • applyRenderSystem

      default void applyRenderSystem()
      Sets default uniforms based on what RenderSystem provides.
    • addRenderSystemTextures

      default void addRenderSystemTextures()
      Applies the RenderSystem textures to Sampler0-Sampler11.
    • setFramebufferSamplers

      default void setFramebufferSamplers(AdvancedFbo framebuffer)
      Sets DiffuseSampler0-DiffuseSamplerMax to the color buffers in the specified framebuffer.
      Parameters:
      framebuffer - The framebuffer to bind samplers from
    • addSampler

      void addSampler(CharSequence name, int textureId)
      Adds a texture that is dynamically bound and sets texture units.
      Parameters:
      name - The name of the texture to set
      textureId - The id of the texture to bind and assign a texture unit
    • removeSampler

      void removeSampler(CharSequence name)
      Removes the specified sampler binding.
      Parameters:
      name - The name of the sampler to remove
    • applyShaderSamplers

      default int applyShaderSamplers(int sampler)
      Loads the samplers set by addSampler(CharSequence, int) into the shader.
      Parameters:
      sampler - The sampler to start binding to
      Returns:
      The next available sampler
    • applyShaderSamplers

      int applyShaderSamplers(@Nullable ShaderTextureSource.Context context, int sampler)
      Loads the samplers set by addSampler(CharSequence, int) into the shader.
      Parameters:
      context - The context for setting built-in shader samplers or null to ignore normal samplers
      sampler - The sampler to start binding to
      Returns:
      The next available sampler
    • clearSamplers

      void clearSamplers()
      Clears all samplers.
    • setUniformBlock

      default void setUniformBlock(CharSequence name, int binding)
      Description copied from interface: UniformAccess
      Sets the binding to use for the specified uniform block.
      Specified by:
      setUniformBlock in interface UniformAccess
      Parameters:
      name - The name of the block to set
      binding - The binding to use for that block
    • setFloat

      default void setFloat(CharSequence name, float value)
      Description copied from interface: UniformAccess
      Sets a float in the shader.
      Specified by:
      setFloat in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      value - The value to set
    • setVector

      default void setVector(CharSequence name, float x, float y)
      Description copied from interface: UniformAccess
      Sets a vector in the shader.
      Specified by:
      setVector in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      x - The x component of the vector
      y - The y component of the vector
    • setVector

      default void setVector(CharSequence name, float x, float y, float z)
      Description copied from interface: UniformAccess
      Sets a vector in the shader.
      Specified by:
      setVector in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      x - The x component of the vector
      y - The y component of the vector
      z - The z component of the vector
    • setVector

      default void setVector(CharSequence name, float x, float y, float z, float w)
      Description copied from interface: UniformAccess
      Sets a vector in the shader.
      Specified by:
      setVector in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      x - The x component of the vector
      y - The y component of the vector
      z - The z component of the vector
      w - The w component of the vector
    • setInt

      default void setInt(CharSequence name, int value)
      Description copied from interface: UniformAccess
      Sets an integer in the shader.
      Specified by:
      setInt in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      value - The value to set
    • setVectorI

      default void setVectorI(CharSequence name, int x, int y)
      Description copied from interface: UniformAccess
      Sets an integer vector in the shader.
      Specified by:
      setVectorI in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      x - The x component of the vector
      y - The y component of the vector
    • setVectorI

      default void setVectorI(CharSequence name, int x, int y, int z)
      Description copied from interface: UniformAccess
      Sets an integer vector in the shader.
      Specified by:
      setVectorI in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      x - The x component of the vector
      y - The y component of the vector
      z - The z component of the vector
    • setVectorI

      default void setVectorI(CharSequence name, int x, int y, int z, int w)
      Description copied from interface: UniformAccess
      Sets an integer vector in the shader.
      Specified by:
      setVectorI in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      x - The x component of the vector
      y - The y component of the vector
      z - The z component of the vector
      w - The w component of the vector
    • setFloats

      default void setFloats(CharSequence name, float... values)
      Description copied from interface: UniformAccess
      Sets an array of floats in the shader.
      Specified by:
      setFloats in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      values - The values to set in order
    • setVectors

      default void setVectors(CharSequence name, org.joml.Vector2fc... values)
      Description copied from interface: UniformAccess
      Sets an array of vectors in the shader.
      Specified by:
      setVectors in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      values - The values to set in order
    • setVectors

      default void setVectors(CharSequence name, org.joml.Vector3fc... values)
      Description copied from interface: UniformAccess
      Sets an array of vectors in the shader.
      Specified by:
      setVectors in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      values - The values to set in order
    • setVectors

      default void setVectors(CharSequence name, org.joml.Vector4fc... values)
      Description copied from interface: UniformAccess
      Sets an array of vectors in the shader.
      Specified by:
      setVectors in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      values - The values to set in order
    • setInts

      default void setInts(CharSequence name, int... values)
      Description copied from interface: UniformAccess
      Sets an array of integers in the shader.
      Specified by:
      setInts in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      values - The values to set in order
    • setVectors

      default void setVectors(CharSequence name, org.joml.Vector2ic... values)
      Description copied from interface: UniformAccess
      Sets an array of integer vectors in the shader.
      Specified by:
      setVectors in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      values - The values to set in order
    • setVectors

      default void setVectors(CharSequence name, org.joml.Vector3ic... values)
      Description copied from interface: UniformAccess
      Sets an array of integer vectors in the shader.
      Specified by:
      setVectors in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      values - The values to set in order
    • setVectors

      default void setVectors(CharSequence name, org.joml.Vector4ic... values)
      Description copied from interface: UniformAccess
      Sets an array of integer vectors in the shader.
      Specified by:
      setVectors in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      values - The values to set in order
    • setMatrix

      default void setMatrix(CharSequence name, org.joml.Matrix2fc value)
      Description copied from interface: UniformAccess
      Sets a matrix in the shader.
      Specified by:
      setMatrix in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      value - The value to set
    • setMatrix

      default void setMatrix(CharSequence name, org.joml.Matrix3fc value)
      Description copied from interface: UniformAccess
      Sets a matrix in the shader.
      Specified by:
      setMatrix in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      value - The value to set
    • setMatrix

      default void setMatrix(CharSequence name, org.joml.Matrix3x2fc value)
      Description copied from interface: UniformAccess
      Sets a matrix in the shader.
      Specified by:
      setMatrix in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      value - The value to set
    • setMatrix

      default void setMatrix(CharSequence name, org.joml.Matrix4fc value)
      Description copied from interface: UniformAccess
      Sets a matrix in the shader.
      Specified by:
      setMatrix in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      value - The value to set
    • setMatrix

      default void setMatrix(CharSequence name, org.joml.Matrix4x3fc value)
      Description copied from interface: UniformAccess
      Sets a matrix in the shader.
      Specified by:
      setMatrix in interface UniformAccess
      Parameters:
      name - The name of the uniform to set
      value - The value to set