Package net.minecraft.client.gl
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 gfh
-
Field Summary
Modifier and TypeFieldDescriptionprivate static ShaderProgram
private static int
private static final String
private static final Uniform
private boolean
private static final boolean
private final VertexFormat
private final ShaderStage
private final int
private static final String
(package private) static final Logger
private final String
static final String
private final ShaderStage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSampler
(String name, Object sampler) private void
addUniform
(JsonElement json) void
void
bind()
void
close()
int
getGlRef()
getName()
getUniform
(String name) getUniformOrDefault
(String name) private void
private static ShaderStage
loadShader
(ResourceFactory factory, ShaderStage.Type type, String name) void
void
method_60897
(VertexFormat.DrawMode drawMode, Matrix4f matrix4f, Matrix4f matrix4f2, Window window) private void
readSampler
(JsonElement json) void
unbind()
-
Field Details
-
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
Lgfh;a:Ljava/lang/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
Lgfh;q:Ljava/lang/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
Lgfh;r:Ljava/lang/String;
-
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
Lgfh;s:Lorg/slf4j/Logger;
-
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
Lgfh;t:Lfal;
-
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
Lgfh;u:Z
-
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
Lgfh;v:Lgfh;
-
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
Lgfh;w:I
-
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
Lgfh;x:Ljava/util/Map;
-
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
Lgfh;y:Ljava/util/List;
-
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
Lgfh;z:Ljava/util/List;
-
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
Lgfh;A:Ljava/util/List;
-
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
Lgfh;B:Ljava/util/List;
-
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
Lgfh;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
Lgfh;D:I
-
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
Lgfh;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
Lgfh;F:Z
-
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 G
Lgfh;G:Lfaq;
-
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 H
Lgfh;H:Lfaq;
-
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 I
Lgfh;I:Lfbh;
-
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
Lgfh;b:Lfat;
-
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
Lgfh;c:Lfat;
-
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
Lgfh;d:Lfat;
-
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
Lgfh;e:Lfat;
-
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
Lgfh;f:Lfat;
-
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
Lgfh;g:Lfat;
-
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
Lgfh;h:Lfat;
-
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
Lgfh;i:Lfat;
-
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
Lgfh;j:Lfat;
-
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
Lgfh;k:Lfat;
-
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
Lgfh;l:Lfat;
-
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
Lgfh;m:Lfat;
-
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
Lgfh;n:Lfat;
-
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
Lgfh;o:Lfat;
-
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
Lgfh;p:Lfat;
-
-
Constructor Details
-
ShaderProgram
- 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>
Lgfh;<init>(Laug;Ljava/lang/String;Lfbh;)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
Lgfh;a(Laug;Lfaq$a;Ljava/lang/String;)Lfaq;
-
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 f
Lgfh;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
Lgfh;g()V
-
markUniformsDirty
public void markUniformsDirty()- Specified by:
markUniformsDirty
in interfaceShaderProgramSetupView
- 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
Lfas;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
Lgfh;a(Ljava/lang/String;)Lfat;
-
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 b
Lgfh;b(Ljava/lang/String;)Lfal;
-
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
Lgfh;j()V
-
readSampler
- 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
Lgfh;a(Lcom/google/gson/JsonElement;)V
-
addSampler
- 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
Lgfh;a(Ljava/lang/String;Ljava/lang/Object;)V
-
addUniform
- 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
Lgfh;b(Lcom/google/gson/JsonElement;)V
-
getVertexShader
- Specified by:
getVertexShader
in interfaceShaderProgramSetupView
- 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
Lfas;c()Lfaq;
-
getFragmentShader
- Specified by:
getFragmentShader
in interfaceShaderProgramSetupView
- 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
Lfas;d()Lfaq;
-
attachReferencedShaders
public void attachReferencedShaders()- Specified by:
attachReferencedShaders
in interfaceShaderProgramSetupView
- 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
Lfas;e()V
-
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
Lgfh;h()Lfbh;
-
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
Lgfh;i()Ljava/lang/String;
-
getGlRef
public int getGlRef()- Specified by:
getGlRef
in interfaceShaderProgramSetupView
- 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
Lfas;a()I
-
method_60897
public void method_60897(VertexFormat.DrawMode drawMode, Matrix4f matrix4f, Matrix4f matrix4f2, Window window) - Mappings:
Namespace Name Mixin selector named method_60897
Lnet/minecraft/client/gl/ShaderProgram;method_60897(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
Lgfh;a(Lfbh$c;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lfag;)V
-