Interface TextureUniformAccess

All Known Subinterfaces:
ShaderProgram
All Known Implementing Classes:
ShaderProgramImpl

public interface TextureUniformAccess
Provides write access to all textures in a shader program.
  • Method Details

    • 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
    • addSamplerListener

      void addSamplerListener(TextureUniformAccess.SamplerListener listener)
      Adds a listener for sampler updates.
      Parameters:
      listener - The listener instance
    • removeSamplerListener

      void removeSamplerListener(TextureUniformAccess.SamplerListener listener)
      Removes a listener from sampler updates.
      Parameters:
      listener - The listener instance
    • 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.