Class ShaderProgram

java.lang.Object
net.minecraft.client.gl.ShaderProgram
All Implemented Interfaces:
AutoCloseable

@Environment(CLIENT) public class ShaderProgram extends Object implements AutoCloseable
Represents a shader program. Also known as a program object that can be created with glCreateProgram.

Warning: This class is referred to as a shader in strings. However, this does NOT represent a shader object that can be created with glCreateShader. CompiledShader is what represents a shader object.

See Also:
Mappings:
Namespace Name
named net/minecraft/client/gl/ShaderProgram
intermediary net/minecraft/class_5944
official gkt
  • Field Details

    • DEFAULT_UNIFORM

      private static final Uniform DEFAULT_UNIFORM
      Mappings:
      Namespace Name Mixin selector
      named DEFAULT_UNIFORM Lnet/minecraft/client/gl/ShaderProgram;DEFAULT_UNIFORM:Lnet/minecraft/client/gl/Uniform;
      intermediary field_29484 Lnet/minecraft/class_5944;field_29484:Lnet/minecraft/class_278;
      official p Lgkt;p:Lfgf;
    • field_53837

      private static final int field_53837
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_53837 Lnet/minecraft/client/gl/ShaderProgram;field_53837:I
      intermediary field_53837 Lnet/minecraft/class_5944;field_53837:I
      official q Lgkt;q:I
    • samplers

      private final List<ShaderProgramDefinition.Sampler> samplers
      Mappings:
      Namespace Name Mixin selector
      named samplers Lnet/minecraft/client/gl/ShaderProgram;samplers:Ljava/util/List;
      intermediary field_53838 Lnet/minecraft/class_5944;field_53838:Ljava/util/List;
      official r Lgkt;r:Ljava/util/List;
    • samplerTextures

      private final Object2IntMap<String> samplerTextures
      Mappings:
      Namespace Name Mixin selector
      named samplerTextures Lnet/minecraft/client/gl/ShaderProgram;samplerTextures:Lit/unimi/dsi/fastutil/objects/Object2IntMap;
      intermediary field_53839 Lnet/minecraft/class_5944;field_53839:Lit/unimi/dsi/fastutil/objects/Object2IntMap;
      official s Lgkt;s:Lit/unimi/dsi/fastutil/objects/Object2IntMap;
    • samplerLocations

      private final IntList samplerLocations
      Mappings:
      Namespace Name Mixin selector
      named samplerLocations Lnet/minecraft/client/gl/ShaderProgram;samplerLocations:Lit/unimi/dsi/fastutil/ints/IntList;
      intermediary field_53840 Lnet/minecraft/class_5944;field_53840:Lit/unimi/dsi/fastutil/ints/IntList;
      official t Lgkt;t:Lit/unimi/dsi/fastutil/ints/IntList;
    • uniforms

      private final List<GlUniform> uniforms
      Mappings:
      Namespace Name Mixin selector
      named uniforms Lnet/minecraft/client/gl/ShaderProgram;uniforms:Ljava/util/List;
      intermediary field_29490 Lnet/minecraft/class_5944;field_29490:Ljava/util/List;
      official u Lgkt;u:Ljava/util/List;
    • uniformsByName

      private final Map<String,GlUniform> uniformsByName
      Mappings:
      Namespace Name Mixin selector
      named uniformsByName Lnet/minecraft/client/gl/ShaderProgram;uniformsByName:Ljava/util/Map;
      intermediary field_53841 Lnet/minecraft/class_5944;field_53841:Ljava/util/Map;
      official v Lgkt;v:Ljava/util/Map;
    • uniformDefinitionsByName

      private final Map<String,ShaderProgramDefinition.Uniform> uniformDefinitionsByName
      Mappings:
      Namespace Name Mixin selector
      named uniformDefinitionsByName Lnet/minecraft/client/gl/ShaderProgram;uniformDefinitionsByName:Ljava/util/Map;
      intermediary field_54926 Lnet/minecraft/class_5944;field_54926:Ljava/util/Map;
      official w Lgkt;w:Ljava/util/Map;
    • glRef

      private final int glRef
      Mappings:
      Namespace Name Mixin selector
      named glRef Lnet/minecraft/client/gl/ShaderProgram;glRef:I
      intermediary field_29493 Lnet/minecraft/class_5944;field_29493:I
      official x Lgkt;x:I
    • modelViewMat

      @Nullable public @Nullable GlUniform modelViewMat
      Mappings:
      Namespace Name Mixin selector
      named modelViewMat Lnet/minecraft/client/gl/ShaderProgram;modelViewMat:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29470 Lnet/minecraft/class_5944;field_29470:Lnet/minecraft/class_284;
      official a Lgkt;a:Lfgi;
    • projectionMat

      @Nullable public @Nullable GlUniform projectionMat
      Mappings:
      Namespace Name Mixin selector
      named projectionMat Lnet/minecraft/client/gl/ShaderProgram;projectionMat:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29471 Lnet/minecraft/class_5944;field_29471:Lnet/minecraft/class_284;
      official b Lgkt;b:Lfgi;
    • textureMat

      @Nullable public @Nullable GlUniform textureMat
      Mappings:
      Namespace Name Mixin selector
      named textureMat Lnet/minecraft/client/gl/ShaderProgram;textureMat:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29472 Lnet/minecraft/class_5944;field_29472:Lnet/minecraft/class_284;
      official c Lgkt;c:Lfgi;
    • screenSize

      @Nullable public @Nullable GlUniform screenSize
      Mappings:
      Namespace Name Mixin selector
      named screenSize Lnet/minecraft/client/gl/ShaderProgram;screenSize:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29473 Lnet/minecraft/class_5944;field_29473:Lnet/minecraft/class_284;
      official d Lgkt;d:Lfgi;
    • colorModulator

      @Nullable public @Nullable GlUniform colorModulator
      Mappings:
      Namespace Name Mixin selector
      named colorModulator Lnet/minecraft/client/gl/ShaderProgram;colorModulator:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29474 Lnet/minecraft/class_5944;field_29474:Lnet/minecraft/class_284;
      official e Lgkt;e:Lfgi;
    • light0Direction

      @Nullable public @Nullable GlUniform light0Direction
      Mappings:
      Namespace Name Mixin selector
      named light0Direction Lnet/minecraft/client/gl/ShaderProgram;light0Direction:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29475 Lnet/minecraft/class_5944;field_29475:Lnet/minecraft/class_284;
      official f Lgkt;f:Lfgi;
    • light1Direction

      @Nullable public @Nullable GlUniform light1Direction
      Mappings:
      Namespace Name Mixin selector
      named light1Direction Lnet/minecraft/client/gl/ShaderProgram;light1Direction:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29476 Lnet/minecraft/class_5944;field_29476:Lnet/minecraft/class_284;
      official g Lgkt;g:Lfgi;
    • glintAlpha

      @Nullable public @Nullable GlUniform glintAlpha
      Mappings:
      Namespace Name Mixin selector
      named glintAlpha Lnet/minecraft/client/gl/ShaderProgram;glintAlpha:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_42231 Lnet/minecraft/class_5944;field_42231:Lnet/minecraft/class_284;
      official h Lgkt;h:Lfgi;
    • fogStart

      @Nullable public @Nullable GlUniform fogStart
      Mappings:
      Namespace Name Mixin selector
      named fogStart Lnet/minecraft/client/gl/ShaderProgram;fogStart:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29477 Lnet/minecraft/class_5944;field_29477:Lnet/minecraft/class_284;
      official i Lgkt;i:Lfgi;
    • fogEnd

      @Nullable public @Nullable GlUniform fogEnd
      Mappings:
      Namespace Name Mixin selector
      named fogEnd Lnet/minecraft/client/gl/ShaderProgram;fogEnd:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29478 Lnet/minecraft/class_5944;field_29478:Lnet/minecraft/class_284;
      official j Lgkt;j:Lfgi;
    • fogColor

      @Nullable public @Nullable GlUniform fogColor
      Mappings:
      Namespace Name Mixin selector
      named fogColor Lnet/minecraft/client/gl/ShaderProgram;fogColor:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29479 Lnet/minecraft/class_5944;field_29479:Lnet/minecraft/class_284;
      official k Lgkt;k:Lfgi;
    • fogShape

      @Nullable public @Nullable GlUniform fogShape
      Mappings:
      Namespace Name Mixin selector
      named fogShape Lnet/minecraft/client/gl/ShaderProgram;fogShape:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_36373 Lnet/minecraft/class_5944;field_36373:Lnet/minecraft/class_284;
      official l Lgkt;l:Lfgi;
    • lineWidth

      @Nullable public @Nullable GlUniform lineWidth
      Mappings:
      Namespace Name Mixin selector
      named lineWidth Lnet/minecraft/client/gl/ShaderProgram;lineWidth:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29480 Lnet/minecraft/class_5944;field_29480:Lnet/minecraft/class_284;
      official m Lgkt;m:Lfgi;
    • gameTime

      @Nullable public @Nullable GlUniform gameTime
      Mappings:
      Namespace Name Mixin selector
      named gameTime Lnet/minecraft/client/gl/ShaderProgram;gameTime:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29481 Lnet/minecraft/class_5944;field_29481:Lnet/minecraft/class_284;
      official n Lgkt;n:Lfgi;
    • modelOffset

      @Nullable public @Nullable GlUniform modelOffset
      Mappings:
      Namespace Name Mixin selector
      named modelOffset Lnet/minecraft/client/gl/ShaderProgram;modelOffset:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_53139 Lnet/minecraft/class_5944;field_53139:Lnet/minecraft/class_284;
      official o Lgkt;o:Lfgi;
  • Constructor Details

    • ShaderProgram

      private ShaderProgram(int glRef)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/client/gl/ShaderProgram;<init>(I)V
      intermediary <init> Lnet/minecraft/class_5944;<init>(I)V
      official <init> Lgkt;<init>(I)V
  • Method Details

    • create

      public static ShaderProgram create(CompiledShader vertexShader, CompiledShader fragmentShader, VertexFormat format) throws ShaderLoader.LoadException
      Throws:
      ShaderLoader.LoadException
      Mappings:
      Namespace Name Mixin selector
      named create Lnet/minecraft/client/gl/ShaderProgram;create(Lnet/minecraft/client/gl/CompiledShader;Lnet/minecraft/client/gl/CompiledShader;Lnet/minecraft/client/render/VertexFormat;)Lnet/minecraft/client/gl/ShaderProgram;
      intermediary method_62896 Lnet/minecraft/class_5944;method_62896(Lnet/minecraft/class_10141;Lnet/minecraft/class_10141;Lnet/minecraft/class_293;)Lnet/minecraft/class_5944;
      official a Lgkt;a(Lfgg;Lfgg;Lfgw;)Lgkt;
    • set

      Mappings:
      Namespace Name Mixin selector
      named set Lnet/minecraft/client/gl/ShaderProgram;set(Ljava/util/List;Ljava/util/List;)V
      intermediary method_62900 Lnet/minecraft/class_5944;method_62900(Ljava/util/List;Ljava/util/List;)V
      official a Lgkt;a(Ljava/util/List;Ljava/util/List;)V
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • unbind

      public void unbind()
      Mappings:
      Namespace Name Mixin selector
      named unbind Lnet/minecraft/client/gl/ShaderProgram;unbind()V
      intermediary method_34585 Lnet/minecraft/class_5944;method_34585()V
      official a Lgkt;a()V
    • bind

      public void bind()
      Mappings:
      Namespace Name Mixin selector
      named bind Lnet/minecraft/client/gl/ShaderProgram;bind()V
      intermediary method_34586 Lnet/minecraft/class_5944;method_34586()V
      official b Lgkt;b()V
    • getUniform

      @Nullable public @Nullable GlUniform getUniform(String name)
      Mappings:
      Namespace Name Mixin selector
      named getUniform Lnet/minecraft/client/gl/ShaderProgram;getUniform(Ljava/lang/String;)Lnet/minecraft/client/gl/GlUniform;
      intermediary method_34582 Lnet/minecraft/class_5944;method_34582(Ljava/lang/String;)Lnet/minecraft/class_284;
      official a Lgkt;a(Ljava/lang/String;)Lfgi;
    • getUniformDefinition

      @Nullable public ShaderProgramDefinition.Uniform getUniformDefinition(String name)
      Mappings:
      Namespace Name Mixin selector
      named getUniformDefinition Lnet/minecraft/client/gl/ShaderProgram;getUniformDefinition(Ljava/lang/String;)Lnet/minecraft/client/gl/ShaderProgramDefinition$Uniform;
      intermediary method_65028 Lnet/minecraft/class_5944;method_65028(Ljava/lang/String;)Lnet/minecraft/class_10157$class_10159;
      official b Lgkt;b(Ljava/lang/String;)Lgmd$b;
    • getUniformOrDefault

      public Uniform getUniformOrDefault(String name)
      Mappings:
      Namespace Name Mixin selector
      named getUniformOrDefault Lnet/minecraft/client/gl/ShaderProgram;getUniformOrDefault(Ljava/lang/String;)Lnet/minecraft/client/gl/Uniform;
      intermediary method_35785 Lnet/minecraft/class_5944;method_35785(Ljava/lang/String;)Lnet/minecraft/class_278;
      official c Lgkt;c(Ljava/lang/String;)Lfgf;
    • addSamplerTexture

      public void addSamplerTexture(String name, int texture)
      Mappings:
      Namespace Name Mixin selector
      named addSamplerTexture Lnet/minecraft/client/gl/ShaderProgram;addSamplerTexture(Ljava/lang/String;I)V
      intermediary method_62899 Lnet/minecraft/class_5944;method_62899(Ljava/lang/String;I)V
      official a Lgkt;a(Ljava/lang/String;I)V
    • createGlUniform

      private GlUniform createGlUniform(ShaderProgramDefinition.Uniform uniform)
      Mappings:
      Namespace Name Mixin selector
      named createGlUniform Lnet/minecraft/client/gl/ShaderProgram;createGlUniform(Lnet/minecraft/client/gl/ShaderProgramDefinition$Uniform;)Lnet/minecraft/client/gl/GlUniform;
      intermediary method_62898 Lnet/minecraft/class_5944;method_62898(Lnet/minecraft/class_10157$class_10159;)Lnet/minecraft/class_284;
      official a Lgkt;a(Lgmd$b;)Lfgi;
    • initializeUniforms

      public void initializeUniforms(VertexFormat.DrawMode drawMode, Matrix4f viewMatrix, Matrix4f projectionMatrix, Window window)
      Mappings:
      Namespace Name Mixin selector
      named initializeUniforms Lnet/minecraft/client/gl/ShaderProgram;initializeUniforms(Lnet/minecraft/client/render/VertexFormat$DrawMode;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lnet/minecraft/client/util/Window;)V
      intermediary method_60897 Lnet/minecraft/class_5944;method_60897(Lnet/minecraft/class_293$class_5596;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lnet/minecraft/class_1041;)V
      official a Lgkt;a(Lfgw$c;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lffu;)V
    • addUniform

      @VisibleForTesting public void addUniform(GlUniform uniform)
      Mappings:
      Namespace Name Mixin selector
      named addUniform Lnet/minecraft/client/gl/ShaderProgram;addUniform(Lnet/minecraft/client/gl/GlUniform;)V
      intermediary method_62897 Lnet/minecraft/class_5944;method_62897(Lnet/minecraft/class_284;)V
      official a Lgkt;a(Lfgi;)V
    • getGlRef

      @VisibleForTesting public int getGlRef()
      Mappings:
      Namespace Name Mixin selector
      named getGlRef Lnet/minecraft/client/gl/ShaderProgram;getGlRef()I
      intermediary method_1270 Lnet/minecraft/class_5944;method_1270()I
      official c Lgkt;c()I