Package net.minecraft.client.gl
Class ShaderProgram
java.lang.Object
net.minecraft.client.gl.ShaderProgram
- All Implemented Interfaces:
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 Summary
Modifier and TypeFieldDescriptionprivate static final Uniform
private static final int
private final int
private final IntList
private final List
<ShaderProgramDefinition.Sampler> private final Object2IntMap
<String> private final Map
<String, ShaderProgramDefinition.Uniform> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSamplerTexture
(String name, int texture) void
addUniform
(GlUniform uniform) void
bind()
void
close()
static ShaderProgram
create
(CompiledShader vertexShader, CompiledShader fragmentShader, VertexFormat format) private GlUniform
int
getGlRef()
getUniform
(String name) getUniformDefinition
(String name) getUniformOrDefault
(String name) void
initializeUniforms
(VertexFormat.DrawMode drawMode, Matrix4f viewMatrix, Matrix4f projectionMatrix, Window window) void
set
(List<ShaderProgramDefinition.Uniform> uniforms, List<ShaderProgramDefinition.Sampler> samplers) void
unbind()
-
Field Details
-
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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
public void set(List<ShaderProgramDefinition.Uniform> uniforms, List<ShaderProgramDefinition.Sampler> samplers) - 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 interfaceAutoCloseable
-
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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
-