Class ShaderProgram

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

@Environment(CLIENT) public class ShaderProgram extends Object implements ShaderProgramSetupView, 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. ShaderStage is what represents a shader object.

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

    • SHADERS_DIRECTORY

      public static final String SHADERS_DIRECTORY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named SHADERS_DIRECTORY Lnet/minecraft/client/gl/ShaderProgram;SHADERS_DIRECTORY:Ljava/lang/String;
      intermediary field_32778 Lnet/minecraft/class_5944;field_32778:Ljava/lang/String;
      official a Lgee;a:Ljava/lang/String;
    • CORE_DIRECTORY

      private static final String CORE_DIRECTORY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named CORE_DIRECTORY Lnet/minecraft/client/gl/ShaderProgram;CORE_DIRECTORY:Ljava/lang/String;
      intermediary field_40512 Lnet/minecraft/class_5944;field_40512:Ljava/lang/String;
      official q Lgee;q:Ljava/lang/String;
    • INCLUDE_DIRECTORY

      private static final String INCLUDE_DIRECTORY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named INCLUDE_DIRECTORY Lnet/minecraft/client/gl/ShaderProgram;INCLUDE_DIRECTORY:Ljava/lang/String;
      intermediary field_32779 Lnet/minecraft/class_5944;field_32779:Ljava/lang/String;
      official r Lgee;r:Ljava/lang/String;
    • LOGGER

      static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      named LOGGER Lnet/minecraft/client/gl/ShaderProgram;LOGGER:Lorg/slf4j/Logger;
      intermediary field_29483 Lnet/minecraft/class_5944;field_29483:Lorg/slf4j/Logger;
      official s Lgee;s:Lorg/slf4j/Logger;
    • 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 t Lgee;t:Lezj;
    • field_32780

      private static final boolean field_32780
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_32780 Lnet/minecraft/client/gl/ShaderProgram;field_32780:Z
      intermediary field_32780 Lnet/minecraft/class_5944;field_32780:Z
      official u Lgee;u:Z
    • activeProgram

      private static ShaderProgram activeProgram
      Mappings:
      Namespace Name Mixin selector
      named activeProgram Lnet/minecraft/client/gl/ShaderProgram;activeProgram:Lnet/minecraft/client/gl/ShaderProgram;
      intermediary field_29485 Lnet/minecraft/class_5944;field_29485:Lnet/minecraft/class_5944;
      official v Lgee;v:Lgee;
    • activeProgramGlRef

      private static int activeProgramGlRef
      Mappings:
      Namespace Name Mixin selector
      named activeProgramGlRef Lnet/minecraft/client/gl/ShaderProgram;activeProgramGlRef:I
      intermediary field_29486 Lnet/minecraft/class_5944;field_29486:I
      official w Lgee;w:I
    • samplers

      private final Map<String,Object> samplers
      Mappings:
      Namespace Name Mixin selector
      named samplers Lnet/minecraft/client/gl/ShaderProgram;samplers:Ljava/util/Map;
      intermediary field_29487 Lnet/minecraft/class_5944;field_29487:Ljava/util/Map;
      official x Lgee;x:Ljava/util/Map;
    • samplerNames

      private final List<String> samplerNames
      Mappings:
      Namespace Name Mixin selector
      named samplerNames Lnet/minecraft/client/gl/ShaderProgram;samplerNames:Ljava/util/List;
      intermediary field_29488 Lnet/minecraft/class_5944;field_29488:Ljava/util/List;
      official y Lgee;y:Ljava/util/List;
    • loadedSamplerIds

      private final List<Integer> loadedSamplerIds
      Mappings:
      Namespace Name Mixin selector
      named loadedSamplerIds Lnet/minecraft/client/gl/ShaderProgram;loadedSamplerIds:Ljava/util/List;
      intermediary field_29489 Lnet/minecraft/class_5944;field_29489:Ljava/util/List;
      official z Lgee;z:Ljava/util/List;
    • 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 A Lgee;A:Ljava/util/List;
    • loadedUniformIds

      private final List<Integer> loadedUniformIds
      Mappings:
      Namespace Name Mixin selector
      named loadedUniformIds Lnet/minecraft/client/gl/ShaderProgram;loadedUniformIds:Ljava/util/List;
      intermediary field_29491 Lnet/minecraft/class_5944;field_29491:Ljava/util/List;
      official B Lgee;B:Ljava/util/List;
    • loadedUniforms

      private final Map<String,GlUniform> loadedUniforms
      Mappings:
      Namespace Name Mixin selector
      named loadedUniforms Lnet/minecraft/client/gl/ShaderProgram;loadedUniforms:Ljava/util/Map;
      intermediary field_29492 Lnet/minecraft/class_5944;field_29492:Ljava/util/Map;
      official C Lgee;C: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 D Lgee;D:I
    • name

      private final String name
      Mappings:
      Namespace Name Mixin selector
      named name Lnet/minecraft/client/gl/ShaderProgram;name:Ljava/lang/String;
      intermediary field_29494 Lnet/minecraft/class_5944;field_29494:Ljava/lang/String;
      official E Lgee;E:Ljava/lang/String;
    • dirty

      private boolean dirty
      Mappings:
      Namespace Name Mixin selector
      named dirty Lnet/minecraft/client/gl/ShaderProgram;dirty:Z
      intermediary field_29495 Lnet/minecraft/class_5944;field_29495:Z
      official F Lgee;F:Z
    • blendState

      private final GlBlendState blendState
      Mappings:
      Namespace Name Mixin selector
      named blendState Lnet/minecraft/client/gl/ShaderProgram;blendState:Lnet/minecraft/client/gl/GlBlendState;
      intermediary field_29464 Lnet/minecraft/class_5944;field_29464:Lnet/minecraft/class_277;
      official G Lgee;G:Lezk;
    • vertexShader

      private final ShaderStage vertexShader
      Mappings:
      Namespace Name Mixin selector
      named vertexShader Lnet/minecraft/client/gl/ShaderProgram;vertexShader:Lnet/minecraft/client/gl/ShaderStage;
      intermediary field_29467 Lnet/minecraft/class_5944;field_29467:Lnet/minecraft/class_281;
      official H Lgee;H:Lezo;
    • fragmentShader

      private final ShaderStage fragmentShader
      Mappings:
      Namespace Name Mixin selector
      named fragmentShader Lnet/minecraft/client/gl/ShaderProgram;fragmentShader:Lnet/minecraft/client/gl/ShaderStage;
      intermediary field_29468 Lnet/minecraft/class_5944;field_29468:Lnet/minecraft/class_281;
      official I Lgee;I:Lezo;
    • format

      private final VertexFormat format
      Mappings:
      Namespace Name Mixin selector
      named format Lnet/minecraft/client/gl/ShaderProgram;format:Lnet/minecraft/client/render/VertexFormat;
      intermediary field_29469 Lnet/minecraft/class_5944;field_29469:Lnet/minecraft/class_293;
      official J Lgee;J:Lfaf;
    • modelViewMat

      @Nullable public final @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 b Lgee;b:Lezr;
    • projectionMat

      @Nullable public final @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 c Lgee;c:Lezr;
    • textureMat

      @Nullable public final @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 d Lgee;d:Lezr;
    • screenSize

      @Nullable public final @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 e Lgee;e:Lezr;
    • colorModulator

      @Nullable public final @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 f Lgee;f:Lezr;
    • light0Direction

      @Nullable public final @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 g Lgee;g:Lezr;
    • light1Direction

      @Nullable public final @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 h Lgee;h:Lezr;
    • glintAlpha

      @Nullable public final @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 i Lgee;i:Lezr;
    • fogStart

      @Nullable public final @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 j Lgee;j:Lezr;
    • fogEnd

      @Nullable public final @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 k Lgee;k:Lezr;
    • fogColor

      @Nullable public final @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 l Lgee;l:Lezr;
    • fogShape

      @Nullable public final @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 m Lgee;m:Lezr;
    • lineWidth

      @Nullable public final @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 n Lgee;n:Lezr;
    • gameTime

      @Nullable public final @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 o Lgee;o:Lezr;
    • chunkOffset

      @Nullable public final @Nullable GlUniform chunkOffset
      Mappings:
      Namespace Name Mixin selector
      named chunkOffset Lnet/minecraft/client/gl/ShaderProgram;chunkOffset:Lnet/minecraft/client/gl/GlUniform;
      intermediary field_29482 Lnet/minecraft/class_5944;field_29482:Lnet/minecraft/class_284;
      official p Lgee;p:Lezr;
  • Constructor Details

    • ShaderProgram

      public ShaderProgram(ResourceFactory factory, String name, VertexFormat format) throws IOException
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/client/gl/ShaderProgram;<init>(Lnet/minecraft/resource/ResourceFactory;Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;)V
      intermediary <init> Lnet/minecraft/class_5944;<init>(Lnet/minecraft/class_5912;Ljava/lang/String;Lnet/minecraft/class_293;)V
      official <init> Lgee;<init>(Laus;Ljava/lang/String;Lfaf;)V
  • Method Details

    • loadShader

      private static ShaderStage loadShader(ResourceFactory factory, ShaderStage.Type type, String name) throws IOException
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named loadShader Lnet/minecraft/client/gl/ShaderProgram;loadShader(Lnet/minecraft/resource/ResourceFactory;Lnet/minecraft/client/gl/ShaderStage$Type;Ljava/lang/String;)Lnet/minecraft/client/gl/ShaderStage;
      intermediary method_34579 Lnet/minecraft/class_5944;method_34579(Lnet/minecraft/class_5912;Lnet/minecraft/class_281$class_282;Ljava/lang/String;)Lnet/minecraft/class_281;
      official a Lgee;a(Laus;Lezo$a;Ljava/lang/String;)Lezo;
    • readBlendState

      public static GlBlendState readBlendState(JsonObject json)
      Mappings:
      Namespace Name Mixin selector
      named readBlendState Lnet/minecraft/client/gl/ShaderProgram;readBlendState(Lcom/google/gson/JsonObject;)Lnet/minecraft/client/gl/GlBlendState;
      intermediary method_34581 Lnet/minecraft/class_5944;method_34581(Lcom/google/gson/JsonObject;)Lnet/minecraft/class_277;
      official a Lgee;a(Lcom/google/gson/JsonObject;)Lezk;
    • 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 f Lgee;f()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 g Lgee;g()V
    • markUniformsDirty

      public void markUniformsDirty()
      Specified by:
      markUniformsDirty in interface ShaderProgramSetupView
      Mappings:
      Namespace Name Mixin selector
      named markUniformsDirty Lnet/minecraft/client/gl/ShaderProgramSetupView;markUniformsDirty()V
      intermediary method_1279 Lnet/minecraft/class_3679;method_1279()V
      official b Lezq;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 Lgee;a(Ljava/lang/String;)Lezr;
    • 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 b Lgee;b(Ljava/lang/String;)Lezj;
    • loadReferences

      private void loadReferences()
      Mappings:
      Namespace Name Mixin selector
      named loadReferences Lnet/minecraft/client/gl/ShaderProgram;loadReferences()V
      intermediary method_34588 Lnet/minecraft/class_5944;method_34588()V
      official j Lgee;j()V
    • readSampler

      private void readSampler(JsonElement json)
      Mappings:
      Namespace Name Mixin selector
      named readSampler Lnet/minecraft/client/gl/ShaderProgram;readSampler(Lcom/google/gson/JsonElement;)V
      intermediary method_34580 Lnet/minecraft/class_5944;method_34580(Lcom/google/gson/JsonElement;)V
      official a Lgee;a(Lcom/google/gson/JsonElement;)V
    • addSampler

      public void addSampler(String name, Object sampler)
      Mappings:
      Namespace Name Mixin selector
      named addSampler Lnet/minecraft/client/gl/ShaderProgram;addSampler(Ljava/lang/String;Ljava/lang/Object;)V
      intermediary method_34583 Lnet/minecraft/class_5944;method_34583(Ljava/lang/String;Ljava/lang/Object;)V
      official a Lgee;a(Ljava/lang/String;Ljava/lang/Object;)V
    • addUniform

      private void addUniform(JsonElement json) throws InvalidHierarchicalFileException
      Throws:
      InvalidHierarchicalFileException
      Mappings:
      Namespace Name Mixin selector
      named addUniform Lnet/minecraft/client/gl/ShaderProgram;addUniform(Lcom/google/gson/JsonElement;)V
      intermediary method_34584 Lnet/minecraft/class_5944;method_34584(Lcom/google/gson/JsonElement;)V
      official b Lgee;b(Lcom/google/gson/JsonElement;)V
    • getVertexShader

      public ShaderStage getVertexShader()
      Specified by:
      getVertexShader in interface ShaderProgramSetupView
      Mappings:
      Namespace Name Mixin selector
      named getVertexShader Lnet/minecraft/client/gl/ShaderProgramSetupView;getVertexShader()Lnet/minecraft/client/gl/ShaderStage;
      intermediary method_1274 Lnet/minecraft/class_3679;method_1274()Lnet/minecraft/class_281;
      official c Lezq;c()Lezo;
    • getFragmentShader

      public ShaderStage getFragmentShader()
      Specified by:
      getFragmentShader in interface ShaderProgramSetupView
      Mappings:
      Namespace Name Mixin selector
      named getFragmentShader Lnet/minecraft/client/gl/ShaderProgramSetupView;getFragmentShader()Lnet/minecraft/client/gl/ShaderStage;
      intermediary method_1278 Lnet/minecraft/class_3679;method_1278()Lnet/minecraft/class_281;
      official d Lezq;d()Lezo;
    • attachReferencedShaders

      public void attachReferencedShaders()
      Specified by:
      attachReferencedShaders in interface ShaderProgramSetupView
      Mappings:
      Namespace Name Mixin selector
      named attachReferencedShaders Lnet/minecraft/client/gl/ShaderProgramSetupView;attachReferencedShaders()V
      intermediary method_34418 Lnet/minecraft/class_3679;method_34418()V
      official e Lezq;e()V
    • getFormat

      public VertexFormat getFormat()
      Mappings:
      Namespace Name Mixin selector
      named getFormat Lnet/minecraft/client/gl/ShaderProgram;getFormat()Lnet/minecraft/client/render/VertexFormat;
      intermediary method_35786 Lnet/minecraft/class_5944;method_35786()Lnet/minecraft/class_293;
      official h Lgee;h()Lfaf;
    • getName

      public String getName()
      Mappings:
      Namespace Name Mixin selector
      named getName Lnet/minecraft/client/gl/ShaderProgram;getName()Ljava/lang/String;
      intermediary method_35787 Lnet/minecraft/class_5944;method_35787()Ljava/lang/String;
      official i Lgee;i()Ljava/lang/String;
    • getGlRef

      public int getGlRef()
      Specified by:
      getGlRef in interface ShaderProgramSetupView
      Mappings:
      Namespace Name Mixin selector
      named getGlRef Lnet/minecraft/client/gl/ShaderProgramSetupView;getGlRef()I
      intermediary method_1270 Lnet/minecraft/class_3679;method_1270()I
      official a Lezq;a()I