Interface TextureUniformAccess

All Known Subinterfaces:
ShaderProgram
All Known Implementing Classes:
DynamicShaderProgramImpl, ShaderProgramImpl

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

    Modifier and Type
    Method
    Description
    default void
    bindSamplers(int samplerStart)
    Loads the samplers set by setTexture(CharSequence, int, int) into the shader.
    void
    bindSamplers(ShaderTextureSource.Context context, int samplerStart)
    Loads the samplers set by setTexture(CharSequence, int, int) into the shader.
    void
    Clears all samplers.
    void
    Removes the specified sampler binding.
    default void
    Sets DiffuseSampler0-DiffuseSamplerMax to the color buffers in the specified framebuffer.
    static void
    setFramebufferSamplers(net.minecraft.client.renderer.ShaderInstance instance, AdvancedFbo framebuffer)
    Sets DiffuseSampler0-DiffuseSamplerMax to the color buffers in the specified framebuffer.
    default void
    setTexture(CharSequence name, int target, int textureId)
    Adds a texture that is dynamically bound and sets texture units.
    void
    setTexture(CharSequence name, int target, int textureId, int samplerId)
    Adds a texture that is dynamically bound and sets texture units.
    default void
    setTexture(CharSequence name, net.minecraft.client.renderer.texture.AbstractTexture texture)
    Adds a texture that is dynamically bound and sets texture units.
    default void
    setTexture(CharSequence name, net.minecraft.client.renderer.texture.AbstractTexture texture, int samplerId)
    Adds a texture that is dynamically bound and sets texture units.
    default void
    setTexture(CharSequence name, net.minecraft.resources.ResourceLocation location)
    Adds a texture that is dynamically bound and sets texture units.
    default void
    setTexture(CharSequence name, net.minecraft.resources.ResourceLocation location, int samplerId)
    Adds a texture that is dynamically bound and sets texture units.
  • Method Details

    • setFramebufferSamplers

      default void setFramebufferSamplers(AdvancedFbo framebuffer)
      Sets DiffuseSampler0-DiffuseSamplerMax to the color buffers in the specified framebuffer.
      Also sets DiffuseDepthSampler if the framebuffer has a depth attachment.
      Parameters:
      framebuffer - The framebuffer to bind samplers from
    • setTexture

      default void setTexture(CharSequence name, net.minecraft.resources.ResourceLocation location)
      Adds a texture that is dynamically bound and sets texture units.
      Parameters:
      name - The name of the texture to set
      location - The name of the texture in the texture manager to bind and assign a texture unit
      Since:
      3.6.0
    • setTexture

      default void setTexture(CharSequence name, net.minecraft.resources.ResourceLocation location, int samplerId)
      Adds a texture that is dynamically bound and sets texture units.
      Parameters:
      name - The name of the texture to set
      location - The name of the texture in the texture manager to bind and assign a texture unit
      samplerId - The id of the sampler assign a texture unit
      Since:
      3.6.0
    • setTexture

      default void setTexture(CharSequence name, net.minecraft.client.renderer.texture.AbstractTexture texture)
      Adds a texture that is dynamically bound and sets texture units.
      Parameters:
      name - The name of the texture to set
      texture - The texture to bind and assign a texture unit
      Since:
      3.6.0
    • setTexture

      default void setTexture(CharSequence name, net.minecraft.client.renderer.texture.AbstractTexture texture, int samplerId)
      Adds a texture that is dynamically bound and sets texture units.
      Parameters:
      name - The name of the texture to set
      texture - The texture to bind and assign a texture unit
      samplerId - The id of the sampler assign a texture unit
      Since:
      3.6.0
    • setTexture

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

      void setTexture(CharSequence name, int target, int textureId, int samplerId)
      Adds a texture that is dynamically bound and sets texture units.
      Parameters:
      name - The name of the texture to set
      target - The target of the texture
      textureId - The id of the texture to bind and assign a texture unit
      samplerId - The id of the sampler assign a texture unit
      Since:
      3.6.0
    • removeTexture

      void removeTexture(CharSequence name)
      Removes the specified sampler binding. This will effectively make it a missing texture.
      Parameters:
      name - The name of the sampler to remove
      Since:
      3.6.0
    • bindSamplers

      default void bindSamplers(int samplerStart)
      Loads the samplers set by setTexture(CharSequence, int, int) into the shader.
      Parameters:
      samplerStart - The sampler to start binding to
    • bindSamplers

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

      void clearSamplers()
      Clears all samplers.
    • setFramebufferSamplers

      static void setFramebufferSamplers(net.minecraft.client.renderer.ShaderInstance instance, AdvancedFbo framebuffer)
      Sets DiffuseSampler0-DiffuseSamplerMax to the color buffers in the specified framebuffer.
      Also sets DiffuseDepthSampler if the framebuffer has a depth attachment.
      Parameters:
      framebuffer - The framebuffer to bind samplers from