Class Shader

java.lang.Object
net.minecraft.client.render.Shader
All Implemented Interfaces:
AutoCloseable, GlShader

@Environment(CLIENT) public class Shader extends Object implements GlShader, AutoCloseable
Represents a program object.

Warning: This does NOT represent a shader object that can be created with glCreateShader. However, this class is referred to as a shader in strings, hence the class name. Program represents a shader object instead.

See Also:
Mappings:
Namespace Name
official fdo
intermediary net/minecraft/class_5944
named net/minecraft/client/render/Shader
  • Field Details

    • SHADERS_DIRECTORY

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

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

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

      static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official s Lfdo;s:Lorg/slf4j/Logger;
      intermediary field_29483 Lnet/minecraft/class_5944;field_29483:Lorg/slf4j/Logger;
      named LOGGER Lnet/minecraft/client/render/Shader;LOGGER:Lorg/slf4j/Logger;
    • DEFAULT_UNIFORM

      private static final Uniform DEFAULT_UNIFORM
      Mappings:
      Namespace Name Mixin selector
      official t Lfdo;t:Ledb;
      intermediary field_29484 Lnet/minecraft/class_5944;field_29484:Lnet/minecraft/class_278;
      named DEFAULT_UNIFORM Lnet/minecraft/client/render/Shader;DEFAULT_UNIFORM:Lnet/minecraft/client/gl/Uniform;
    • field_32780

      private static final boolean field_32780
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official u Lfdo;u:Z
      intermediary field_32780 Lnet/minecraft/class_5944;field_32780:Z
      named field_32780 Lnet/minecraft/client/render/Shader;field_32780:Z
    • activeShader

      private static Shader activeShader
      Mappings:
      Namespace Name Mixin selector
      official v Lfdo;v:Lfdo;
      intermediary field_29485 Lnet/minecraft/class_5944;field_29485:Lnet/minecraft/class_5944;
      named activeShader Lnet/minecraft/client/render/Shader;activeShader:Lnet/minecraft/client/render/Shader;
    • activeShaderId

      private static int activeShaderId
      Mappings:
      Namespace Name Mixin selector
      official w Lfdo;w:I
      intermediary field_29486 Lnet/minecraft/class_5944;field_29486:I
      named activeShaderId Lnet/minecraft/client/render/Shader;activeShaderId:I
    • samplers

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

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

      private final List<Integer> loadedSamplerIds
      Mappings:
      Namespace Name Mixin selector
      official z Lfdo;z:Ljava/util/List;
      intermediary field_29489 Lnet/minecraft/class_5944;field_29489:Ljava/util/List;
      named loadedSamplerIds Lnet/minecraft/client/render/Shader;loadedSamplerIds:Ljava/util/List;
    • uniforms

      private final List<GlUniform> uniforms
      Mappings:
      Namespace Name Mixin selector
      official A Lfdo;A:Ljava/util/List;
      intermediary field_29490 Lnet/minecraft/class_5944;field_29490:Ljava/util/List;
      named uniforms Lnet/minecraft/client/render/Shader;uniforms:Ljava/util/List;
    • loadedUniformIds

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

      private final Map<String,GlUniform> loadedUniforms
      Mappings:
      Namespace Name Mixin selector
      official C Lfdo;C:Ljava/util/Map;
      intermediary field_29492 Lnet/minecraft/class_5944;field_29492:Ljava/util/Map;
      named loadedUniforms Lnet/minecraft/client/render/Shader;loadedUniforms:Ljava/util/Map;
    • programId

      private final int programId
      Mappings:
      Namespace Name Mixin selector
      official D Lfdo;D:I
      intermediary field_29493 Lnet/minecraft/class_5944;field_29493:I
      named programId Lnet/minecraft/client/render/Shader;programId:I
    • name

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

      private boolean dirty
      Mappings:
      Namespace Name Mixin selector
      official F Lfdo;F:Z
      intermediary field_29495 Lnet/minecraft/class_5944;field_29495:Z
      named dirty Lnet/minecraft/client/render/Shader;dirty:Z
    • blendState

      private final GlBlendState blendState
      Mappings:
      Namespace Name Mixin selector
      official G Lfdo;G:Ledc;
      intermediary field_29464 Lnet/minecraft/class_5944;field_29464:Lnet/minecraft/class_277;
      named blendState Lnet/minecraft/client/render/Shader;blendState:Lnet/minecraft/client/gl/GlBlendState;
    • loadedAttributeIds

      private final List<Integer> loadedAttributeIds
      Mappings:
      Namespace Name Mixin selector
      official H Lfdo;H:Ljava/util/List;
      intermediary field_29465 Lnet/minecraft/class_5944;field_29465:Ljava/util/List;
      named loadedAttributeIds Lnet/minecraft/client/render/Shader;loadedAttributeIds:Ljava/util/List;
    • attributeNames

      private final List<String> attributeNames
      Mappings:
      Namespace Name Mixin selector
      official I Lfdo;I:Ljava/util/List;
      intermediary field_29466 Lnet/minecraft/class_5944;field_29466:Ljava/util/List;
      named attributeNames Lnet/minecraft/client/render/Shader;attributeNames:Ljava/util/List;
    • vertexShader

      private final Program vertexShader
      Mappings:
      Namespace Name Mixin selector
      official J Lfdo;J:Ledg;
      intermediary field_29467 Lnet/minecraft/class_5944;field_29467:Lnet/minecraft/class_281;
      named vertexShader Lnet/minecraft/client/render/Shader;vertexShader:Lnet/minecraft/client/gl/Program;
    • fragmentShader

      private final Program fragmentShader
      Mappings:
      Namespace Name Mixin selector
      official K Lfdo;K:Ledg;
      intermediary field_29468 Lnet/minecraft/class_5944;field_29468:Lnet/minecraft/class_281;
      named fragmentShader Lnet/minecraft/client/render/Shader;fragmentShader:Lnet/minecraft/client/gl/Program;
    • format

      private final VertexFormat format
      Mappings:
      Namespace Name Mixin selector
      official L Lfdo;L:Ledx;
      intermediary field_29469 Lnet/minecraft/class_5944;field_29469:Lnet/minecraft/class_293;
      named format Lnet/minecraft/client/render/Shader;format:Lnet/minecraft/client/render/VertexFormat;
    • modelViewMat

      @Nullable public final @Nullable GlUniform modelViewMat
      Mappings:
      Namespace Name Mixin selector
      official b Lfdo;b:Ledj;
      intermediary field_29470 Lnet/minecraft/class_5944;field_29470:Lnet/minecraft/class_284;
      named modelViewMat Lnet/minecraft/client/render/Shader;modelViewMat:Lnet/minecraft/client/gl/GlUniform;
    • projectionMat

      @Nullable public final @Nullable GlUniform projectionMat
      Mappings:
      Namespace Name Mixin selector
      official c Lfdo;c:Ledj;
      intermediary field_29471 Lnet/minecraft/class_5944;field_29471:Lnet/minecraft/class_284;
      named projectionMat Lnet/minecraft/client/render/Shader;projectionMat:Lnet/minecraft/client/gl/GlUniform;
    • viewRotationMat

      @Nullable public final @Nullable GlUniform viewRotationMat
      Mappings:
      Namespace Name Mixin selector
      official d Lfdo;d:Ledj;
      intermediary field_36323 Lnet/minecraft/class_5944;field_36323:Lnet/minecraft/class_284;
      named viewRotationMat Lnet/minecraft/client/render/Shader;viewRotationMat:Lnet/minecraft/client/gl/GlUniform;
    • textureMat

      @Nullable public final @Nullable GlUniform textureMat
      Mappings:
      Namespace Name Mixin selector
      official e Lfdo;e:Ledj;
      intermediary field_29472 Lnet/minecraft/class_5944;field_29472:Lnet/minecraft/class_284;
      named textureMat Lnet/minecraft/client/render/Shader;textureMat:Lnet/minecraft/client/gl/GlUniform;
    • screenSize

      @Nullable public final @Nullable GlUniform screenSize
      Mappings:
      Namespace Name Mixin selector
      official f Lfdo;f:Ledj;
      intermediary field_29473 Lnet/minecraft/class_5944;field_29473:Lnet/minecraft/class_284;
      named screenSize Lnet/minecraft/client/render/Shader;screenSize:Lnet/minecraft/client/gl/GlUniform;
    • colorModulator

      @Nullable public final @Nullable GlUniform colorModulator
      Mappings:
      Namespace Name Mixin selector
      official g Lfdo;g:Ledj;
      intermediary field_29474 Lnet/minecraft/class_5944;field_29474:Lnet/minecraft/class_284;
      named colorModulator Lnet/minecraft/client/render/Shader;colorModulator:Lnet/minecraft/client/gl/GlUniform;
    • light0Direction

      @Nullable public final @Nullable GlUniform light0Direction
      Mappings:
      Namespace Name Mixin selector
      official h Lfdo;h:Ledj;
      intermediary field_29475 Lnet/minecraft/class_5944;field_29475:Lnet/minecraft/class_284;
      named light0Direction Lnet/minecraft/client/render/Shader;light0Direction:Lnet/minecraft/client/gl/GlUniform;
    • light1Direction

      @Nullable public final @Nullable GlUniform light1Direction
      Mappings:
      Namespace Name Mixin selector
      official i Lfdo;i:Ledj;
      intermediary field_29476 Lnet/minecraft/class_5944;field_29476:Lnet/minecraft/class_284;
      named light1Direction Lnet/minecraft/client/render/Shader;light1Direction:Lnet/minecraft/client/gl/GlUniform;
    • fogStart

      @Nullable public final @Nullable GlUniform fogStart
      Mappings:
      Namespace Name Mixin selector
      official j Lfdo;j:Ledj;
      intermediary field_29477 Lnet/minecraft/class_5944;field_29477:Lnet/minecraft/class_284;
      named fogStart Lnet/minecraft/client/render/Shader;fogStart:Lnet/minecraft/client/gl/GlUniform;
    • fogEnd

      @Nullable public final @Nullable GlUniform fogEnd
      Mappings:
      Namespace Name Mixin selector
      official k Lfdo;k:Ledj;
      intermediary field_29478 Lnet/minecraft/class_5944;field_29478:Lnet/minecraft/class_284;
      named fogEnd Lnet/minecraft/client/render/Shader;fogEnd:Lnet/minecraft/client/gl/GlUniform;
    • fogColor

      @Nullable public final @Nullable GlUniform fogColor
      Mappings:
      Namespace Name Mixin selector
      official l Lfdo;l:Ledj;
      intermediary field_29479 Lnet/minecraft/class_5944;field_29479:Lnet/minecraft/class_284;
      named fogColor Lnet/minecraft/client/render/Shader;fogColor:Lnet/minecraft/client/gl/GlUniform;
    • fogShape

      @Nullable public final @Nullable GlUniform fogShape
      Mappings:
      Namespace Name Mixin selector
      official m Lfdo;m:Ledj;
      intermediary field_36373 Lnet/minecraft/class_5944;field_36373:Lnet/minecraft/class_284;
      named fogShape Lnet/minecraft/client/render/Shader;fogShape:Lnet/minecraft/client/gl/GlUniform;
    • lineWidth

      @Nullable public final @Nullable GlUniform lineWidth
      Mappings:
      Namespace Name Mixin selector
      official n Lfdo;n:Ledj;
      intermediary field_29480 Lnet/minecraft/class_5944;field_29480:Lnet/minecraft/class_284;
      named lineWidth Lnet/minecraft/client/render/Shader;lineWidth:Lnet/minecraft/client/gl/GlUniform;
    • gameTime

      @Nullable public final @Nullable GlUniform gameTime
      Mappings:
      Namespace Name Mixin selector
      official o Lfdo;o:Ledj;
      intermediary field_29481 Lnet/minecraft/class_5944;field_29481:Lnet/minecraft/class_284;
      named gameTime Lnet/minecraft/client/render/Shader;gameTime:Lnet/minecraft/client/gl/GlUniform;
    • chunkOffset

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

    • Shader

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

    • loadProgram

      private static Program loadProgram(ResourceFactory factory, Program.Type type, String name) throws IOException
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      official a Lfdo;a(Lakf;Ledg$a;Ljava/lang/String;)Ledg;
      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;
      named loadProgram Lnet/minecraft/client/render/Shader;loadProgram(Lnet/minecraft/resource/ResourceFactory;Lnet/minecraft/client/gl/Program$Type;Ljava/lang/String;)Lnet/minecraft/client/gl/Program;
    • readBlendState

      public static GlBlendState readBlendState(JsonObject json)
      Mappings:
      Namespace Name Mixin selector
      official a Lfdo;a(Lcom/google/gson/JsonObject;)Ledc;
      intermediary method_34581 Lnet/minecraft/class_5944;method_34581(Lcom/google/gson/JsonObject;)Lnet/minecraft/class_277;
      named readBlendState Lnet/minecraft/client/render/Shader;readBlendState(Lcom/google/gson/JsonObject;)Lnet/minecraft/client/gl/GlBlendState;
    • close

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

      public void unbind()
      Mappings:
      Namespace Name Mixin selector
      official f Lfdo;f()V
      intermediary method_34585 Lnet/minecraft/class_5944;method_34585()V
      named unbind Lnet/minecraft/client/render/Shader;unbind()V
    • bind

      public void bind()
      Mappings:
      Namespace Name Mixin selector
      official g Lfdo;g()V
      intermediary method_34586 Lnet/minecraft/class_5944;method_34586()V
      named bind Lnet/minecraft/client/render/Shader;bind()V
    • markUniformsDirty

      public void markUniformsDirty()
      Specified by:
      markUniformsDirty in interface GlShader
      Mappings:
      Namespace Name Mixin selector
      official b Ledi;b()V
      intermediary method_1279 Lnet/minecraft/class_3679;method_1279()V
      named markUniformsDirty Lnet/minecraft/client/gl/GlShader;markUniformsDirty()V
    • getUniform

      @Nullable public @Nullable GlUniform getUniform(String name)
      Mappings:
      Namespace Name Mixin selector
      official a Lfdo;a(Ljava/lang/String;)Ledj;
      intermediary method_34582 Lnet/minecraft/class_5944;method_34582(Ljava/lang/String;)Lnet/minecraft/class_284;
      named getUniform Lnet/minecraft/client/render/Shader;getUniform(Ljava/lang/String;)Lnet/minecraft/client/gl/GlUniform;
    • getUniformOrDefault

      public Uniform getUniformOrDefault(String name)
      Mappings:
      Namespace Name Mixin selector
      official b Lfdo;b(Ljava/lang/String;)Ledb;
      intermediary method_35785 Lnet/minecraft/class_5944;method_35785(Ljava/lang/String;)Lnet/minecraft/class_278;
      named getUniformOrDefault Lnet/minecraft/client/render/Shader;getUniformOrDefault(Ljava/lang/String;)Lnet/minecraft/client/gl/Uniform;
    • loadReferences

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

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

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

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

      public Program getVertexShader()
      Specified by:
      getVertexShader in interface GlShader
      Mappings:
      Namespace Name Mixin selector
      official c Ledi;c()Ledg;
      intermediary method_1274 Lnet/minecraft/class_3679;method_1274()Lnet/minecraft/class_281;
      named getVertexShader Lnet/minecraft/client/gl/GlShader;getVertexShader()Lnet/minecraft/client/gl/Program;
    • getFragmentShader

      public Program getFragmentShader()
      Specified by:
      getFragmentShader in interface GlShader
      Mappings:
      Namespace Name Mixin selector
      official d Ledi;d()Ledg;
      intermediary method_1278 Lnet/minecraft/class_3679;method_1278()Lnet/minecraft/class_281;
      named getFragmentShader Lnet/minecraft/client/gl/GlShader;getFragmentShader()Lnet/minecraft/client/gl/Program;
    • attachReferencedShaders

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

      public VertexFormat getFormat()
      Mappings:
      Namespace Name Mixin selector
      official h Lfdo;h()Ledx;
      intermediary method_35786 Lnet/minecraft/class_5944;method_35786()Lnet/minecraft/class_293;
      named getFormat Lnet/minecraft/client/render/Shader;getFormat()Lnet/minecraft/client/render/VertexFormat;
    • getName

      public String getName()
      Mappings:
      Namespace Name Mixin selector
      official i Lfdo;i()Ljava/lang/String;
      intermediary method_35787 Lnet/minecraft/class_5944;method_35787()Ljava/lang/String;
      named getName Lnet/minecraft/client/render/Shader;getName()Ljava/lang/String;
    • getProgramRef

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