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 official feg
intermediary net/minecraft/class_5944
named net/minecraft/client/gl/ShaderProgram
-
Field Summary
Modifier and TypeFieldDescriptionprivate static ShaderProgram
private static int
private final GlBlendState
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
static GlBlendState
readBlendState
(JsonObject json) private void
readSampler
(JsonElement json) void
unbind()
-
Field Details
-
SHADERS_DIRECTORY
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lfeg;a:Ljava/lang/String;
intermediary field_32778
Lnet/minecraft/class_5944;field_32778:Ljava/lang/String;
named SHADERS_DIRECTORY
Lnet/minecraft/client/gl/ShaderProgram;SHADERS_DIRECTORY:Ljava/lang/String;
-
CORE_DIRECTORY
- See Also:
- Mappings:
Namespace Name Mixin selector official q
Lfeg;q:Ljava/lang/String;
intermediary field_40512
Lnet/minecraft/class_5944;field_40512:Ljava/lang/String;
named CORE_DIRECTORY
Lnet/minecraft/client/gl/ShaderProgram;CORE_DIRECTORY:Ljava/lang/String;
-
INCLUDE_DIRECTORY
- See Also:
- Mappings:
Namespace Name Mixin selector official r
Lfeg;r:Ljava/lang/String;
intermediary field_32779
Lnet/minecraft/class_5944;field_32779:Ljava/lang/String;
named INCLUDE_DIRECTORY
Lnet/minecraft/client/gl/ShaderProgram;INCLUDE_DIRECTORY:Ljava/lang/String;
-
LOGGER
- Mappings:
Namespace Name Mixin selector official s
Lfeg;s:Lorg/slf4j/Logger;
intermediary field_29483
Lnet/minecraft/class_5944;field_29483:Lorg/slf4j/Logger;
named LOGGER
Lnet/minecraft/client/gl/ShaderProgram;LOGGER:Lorg/slf4j/Logger;
-
DEFAULT_UNIFORM
- Mappings:
Namespace Name Mixin selector official t
Lfeg;t:Ledm;
intermediary field_29484
Lnet/minecraft/class_5944;field_29484:Lnet/minecraft/class_278;
named DEFAULT_UNIFORM
Lnet/minecraft/client/gl/ShaderProgram;DEFAULT_UNIFORM:Lnet/minecraft/client/gl/Uniform;
-
field_32780
private static final boolean field_32780- See Also:
- Mappings:
Namespace Name Mixin selector official u
Lfeg;u:Z
intermediary field_32780
Lnet/minecraft/class_5944;field_32780:Z
named field_32780
Lnet/minecraft/client/gl/ShaderProgram;field_32780:Z
-
activeProgram
- Mappings:
Namespace Name Mixin selector official v
Lfeg;v:Lfeg;
intermediary field_29485
Lnet/minecraft/class_5944;field_29485:Lnet/minecraft/class_5944;
named activeProgram
Lnet/minecraft/client/gl/ShaderProgram;activeProgram:Lnet/minecraft/client/gl/ShaderProgram;
-
activeProgramGlRef
private static int activeProgramGlRef- Mappings:
Namespace Name Mixin selector official w
Lfeg;w:I
intermediary field_29486
Lnet/minecraft/class_5944;field_29486:I
named activeProgramGlRef
Lnet/minecraft/client/gl/ShaderProgram;activeProgramGlRef:I
-
samplers
- Mappings:
Namespace Name Mixin selector official x
Lfeg;x:Ljava/util/Map;
intermediary field_29487
Lnet/minecraft/class_5944;field_29487:Ljava/util/Map;
named samplers
Lnet/minecraft/client/gl/ShaderProgram;samplers:Ljava/util/Map;
-
samplerNames
- Mappings:
Namespace Name Mixin selector official y
Lfeg;y:Ljava/util/List;
intermediary field_29488
Lnet/minecraft/class_5944;field_29488:Ljava/util/List;
named samplerNames
Lnet/minecraft/client/gl/ShaderProgram;samplerNames:Ljava/util/List;
-
loadedSamplerIds
- Mappings:
Namespace Name Mixin selector official z
Lfeg;z:Ljava/util/List;
intermediary field_29489
Lnet/minecraft/class_5944;field_29489:Ljava/util/List;
named loadedSamplerIds
Lnet/minecraft/client/gl/ShaderProgram;loadedSamplerIds:Ljava/util/List;
-
uniforms
- Mappings:
Namespace Name Mixin selector official A
Lfeg;A:Ljava/util/List;
intermediary field_29490
Lnet/minecraft/class_5944;field_29490:Ljava/util/List;
named uniforms
Lnet/minecraft/client/gl/ShaderProgram;uniforms:Ljava/util/List;
-
loadedUniformIds
- Mappings:
Namespace Name Mixin selector official B
Lfeg;B:Ljava/util/List;
intermediary field_29491
Lnet/minecraft/class_5944;field_29491:Ljava/util/List;
named loadedUniformIds
Lnet/minecraft/client/gl/ShaderProgram;loadedUniformIds:Ljava/util/List;
-
loadedUniforms
- Mappings:
Namespace Name Mixin selector official C
Lfeg;C:Ljava/util/Map;
intermediary field_29492
Lnet/minecraft/class_5944;field_29492:Ljava/util/Map;
named loadedUniforms
Lnet/minecraft/client/gl/ShaderProgram;loadedUniforms:Ljava/util/Map;
-
glRef
private final int glRef- Mappings:
Namespace Name Mixin selector official D
Lfeg;D:I
intermediary field_29493
Lnet/minecraft/class_5944;field_29493:I
named glRef
Lnet/minecraft/client/gl/ShaderProgram;glRef:I
-
name
- Mappings:
Namespace Name Mixin selector official E
Lfeg;E:Ljava/lang/String;
intermediary field_29494
Lnet/minecraft/class_5944;field_29494:Ljava/lang/String;
named name
Lnet/minecraft/client/gl/ShaderProgram;name:Ljava/lang/String;
-
dirty
private boolean dirty- Mappings:
Namespace Name Mixin selector official F
Lfeg;F:Z
intermediary field_29495
Lnet/minecraft/class_5944;field_29495:Z
named dirty
Lnet/minecraft/client/gl/ShaderProgram;dirty:Z
-
blendState
- Mappings:
Namespace Name Mixin selector official G
Lfeg;G:Ledn;
intermediary field_29464
Lnet/minecraft/class_5944;field_29464:Lnet/minecraft/class_277;
named blendState
Lnet/minecraft/client/gl/ShaderProgram;blendState:Lnet/minecraft/client/gl/GlBlendState;
-
loadedAttributeIds
- Mappings:
Namespace Name Mixin selector official H
Lfeg;H:Ljava/util/List;
intermediary field_29465
Lnet/minecraft/class_5944;field_29465:Ljava/util/List;
named loadedAttributeIds
Lnet/minecraft/client/gl/ShaderProgram;loadedAttributeIds:Ljava/util/List;
-
attributeNames
- Mappings:
Namespace Name Mixin selector official I
Lfeg;I:Ljava/util/List;
intermediary field_29466
Lnet/minecraft/class_5944;field_29466:Ljava/util/List;
named attributeNames
Lnet/minecraft/client/gl/ShaderProgram;attributeNames:Ljava/util/List;
-
vertexShader
- Mappings:
Namespace Name Mixin selector official J
Lfeg;J:Ledr;
intermediary field_29467
Lnet/minecraft/class_5944;field_29467:Lnet/minecraft/class_281;
named vertexShader
Lnet/minecraft/client/gl/ShaderProgram;vertexShader:Lnet/minecraft/client/gl/ShaderStage;
-
fragmentShader
- Mappings:
Namespace Name Mixin selector official K
Lfeg;K:Ledr;
intermediary field_29468
Lnet/minecraft/class_5944;field_29468:Lnet/minecraft/class_281;
named fragmentShader
Lnet/minecraft/client/gl/ShaderProgram;fragmentShader:Lnet/minecraft/client/gl/ShaderStage;
-
format
- Mappings:
Namespace Name Mixin selector official L
Lfeg;L:Leei;
intermediary field_29469
Lnet/minecraft/class_5944;field_29469:Lnet/minecraft/class_293;
named format
Lnet/minecraft/client/gl/ShaderProgram;format:Lnet/minecraft/client/render/VertexFormat;
-
modelViewMat
- Mappings:
Namespace Name Mixin selector official b
Lfeg;b:Ledu;
intermediary field_29470
Lnet/minecraft/class_5944;field_29470:Lnet/minecraft/class_284;
named modelViewMat
Lnet/minecraft/client/gl/ShaderProgram;modelViewMat:Lnet/minecraft/client/gl/GlUniform;
-
projectionMat
- Mappings:
Namespace Name Mixin selector official c
Lfeg;c:Ledu;
intermediary field_29471
Lnet/minecraft/class_5944;field_29471:Lnet/minecraft/class_284;
named projectionMat
Lnet/minecraft/client/gl/ShaderProgram;projectionMat:Lnet/minecraft/client/gl/GlUniform;
-
viewRotationMat
- Mappings:
Namespace Name Mixin selector official d
Lfeg;d:Ledu;
intermediary field_36323
Lnet/minecraft/class_5944;field_36323:Lnet/minecraft/class_284;
named viewRotationMat
Lnet/minecraft/client/gl/ShaderProgram;viewRotationMat:Lnet/minecraft/client/gl/GlUniform;
-
textureMat
- Mappings:
Namespace Name Mixin selector official e
Lfeg;e:Ledu;
intermediary field_29472
Lnet/minecraft/class_5944;field_29472:Lnet/minecraft/class_284;
named textureMat
Lnet/minecraft/client/gl/ShaderProgram;textureMat:Lnet/minecraft/client/gl/GlUniform;
-
screenSize
- Mappings:
Namespace Name Mixin selector official f
Lfeg;f:Ledu;
intermediary field_29473
Lnet/minecraft/class_5944;field_29473:Lnet/minecraft/class_284;
named screenSize
Lnet/minecraft/client/gl/ShaderProgram;screenSize:Lnet/minecraft/client/gl/GlUniform;
-
colorModulator
- Mappings:
Namespace Name Mixin selector official g
Lfeg;g:Ledu;
intermediary field_29474
Lnet/minecraft/class_5944;field_29474:Lnet/minecraft/class_284;
named colorModulator
Lnet/minecraft/client/gl/ShaderProgram;colorModulator:Lnet/minecraft/client/gl/GlUniform;
-
light0Direction
- Mappings:
Namespace Name Mixin selector official h
Lfeg;h:Ledu;
intermediary field_29475
Lnet/minecraft/class_5944;field_29475:Lnet/minecraft/class_284;
named light0Direction
Lnet/minecraft/client/gl/ShaderProgram;light0Direction:Lnet/minecraft/client/gl/GlUniform;
-
light1Direction
- Mappings:
Namespace Name Mixin selector official i
Lfeg;i:Ledu;
intermediary field_29476
Lnet/minecraft/class_5944;field_29476:Lnet/minecraft/class_284;
named light1Direction
Lnet/minecraft/client/gl/ShaderProgram;light1Direction:Lnet/minecraft/client/gl/GlUniform;
-
fogStart
- Mappings:
Namespace Name Mixin selector official j
Lfeg;j:Ledu;
intermediary field_29477
Lnet/minecraft/class_5944;field_29477:Lnet/minecraft/class_284;
named fogStart
Lnet/minecraft/client/gl/ShaderProgram;fogStart:Lnet/minecraft/client/gl/GlUniform;
-
fogEnd
- Mappings:
Namespace Name Mixin selector official k
Lfeg;k:Ledu;
intermediary field_29478
Lnet/minecraft/class_5944;field_29478:Lnet/minecraft/class_284;
named fogEnd
Lnet/minecraft/client/gl/ShaderProgram;fogEnd:Lnet/minecraft/client/gl/GlUniform;
-
fogColor
- Mappings:
Namespace Name Mixin selector official l
Lfeg;l:Ledu;
intermediary field_29479
Lnet/minecraft/class_5944;field_29479:Lnet/minecraft/class_284;
named fogColor
Lnet/minecraft/client/gl/ShaderProgram;fogColor:Lnet/minecraft/client/gl/GlUniform;
-
fogShape
- Mappings:
Namespace Name Mixin selector official m
Lfeg;m:Ledu;
intermediary field_36373
Lnet/minecraft/class_5944;field_36373:Lnet/minecraft/class_284;
named fogShape
Lnet/minecraft/client/gl/ShaderProgram;fogShape:Lnet/minecraft/client/gl/GlUniform;
-
lineWidth
- Mappings:
Namespace Name Mixin selector official n
Lfeg;n:Ledu;
intermediary field_29480
Lnet/minecraft/class_5944;field_29480:Lnet/minecraft/class_284;
named lineWidth
Lnet/minecraft/client/gl/ShaderProgram;lineWidth:Lnet/minecraft/client/gl/GlUniform;
-
gameTime
- Mappings:
Namespace Name Mixin selector official o
Lfeg;o:Ledu;
intermediary field_29481
Lnet/minecraft/class_5944;field_29481:Lnet/minecraft/class_284;
named gameTime
Lnet/minecraft/client/gl/ShaderProgram;gameTime:Lnet/minecraft/client/gl/GlUniform;
-
chunkOffset
- Mappings:
Namespace Name Mixin selector official p
Lfeg;p:Ledu;
intermediary field_29482
Lnet/minecraft/class_5944;field_29482:Lnet/minecraft/class_284;
named chunkOffset
Lnet/minecraft/client/gl/ShaderProgram;chunkOffset:Lnet/minecraft/client/gl/GlUniform;
-
-
Constructor Details
-
ShaderProgram
- Throws:
IOException
- Mappings:
Namespace Name Mixin selector official <init>
Lfeg;<init>(Lakh;Ljava/lang/String;Leei;)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/gl/ShaderProgram;<init>(Lnet/minecraft/resource/ResourceFactory;Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;)V
-
-
Method Details
-
loadShader
private static ShaderStage loadShader(ResourceFactory factory, ShaderStage.Type type, String name) throws IOException - Throws:
IOException
- Mappings:
Namespace Name Mixin selector official a
Lfeg;a(Lakh;Ledr$a;Ljava/lang/String;)Ledr;
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 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;
-
readBlendState
- Mappings:
Namespace Name Mixin selector official a
Lfeg;a(Lcom/google/gson/JsonObject;)Ledn;
intermediary method_34581
Lnet/minecraft/class_5944;method_34581(Lcom/google/gson/JsonObject;)Lnet/minecraft/class_277;
named readBlendState
Lnet/minecraft/client/gl/ShaderProgram;readBlendState(Lcom/google/gson/JsonObject;)Lnet/minecraft/client/gl/GlBlendState;
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
unbind
public void unbind()- Mappings:
Namespace Name Mixin selector official f
Lfeg;f()V
intermediary method_34585
Lnet/minecraft/class_5944;method_34585()V
named unbind
Lnet/minecraft/client/gl/ShaderProgram;unbind()V
-
bind
public void bind()- Mappings:
Namespace Name Mixin selector official g
Lfeg;g()V
intermediary method_34586
Lnet/minecraft/class_5944;method_34586()V
named bind
Lnet/minecraft/client/gl/ShaderProgram;bind()V
-
markUniformsDirty
public void markUniformsDirty()- Specified by:
markUniformsDirty
in interfaceShaderProgramSetupView
- Mappings:
Namespace Name Mixin selector official b
Ledt;b()V
intermediary method_1279
Lnet/minecraft/class_3679;method_1279()V
named markUniformsDirty
Lnet/minecraft/client/gl/ShaderProgramSetupView;markUniformsDirty()V
-
getUniform
- Mappings:
Namespace Name Mixin selector official a
Lfeg;a(Ljava/lang/String;)Ledu;
intermediary method_34582
Lnet/minecraft/class_5944;method_34582(Ljava/lang/String;)Lnet/minecraft/class_284;
named getUniform
Lnet/minecraft/client/gl/ShaderProgram;getUniform(Ljava/lang/String;)Lnet/minecraft/client/gl/GlUniform;
-
getUniformOrDefault
- Mappings:
Namespace Name Mixin selector official b
Lfeg;b(Ljava/lang/String;)Ledm;
intermediary method_35785
Lnet/minecraft/class_5944;method_35785(Ljava/lang/String;)Lnet/minecraft/class_278;
named getUniformOrDefault
Lnet/minecraft/client/gl/ShaderProgram;getUniformOrDefault(Ljava/lang/String;)Lnet/minecraft/client/gl/Uniform;
-
loadReferences
private void loadReferences()- Mappings:
Namespace Name Mixin selector official j
Lfeg;j()V
intermediary method_34588
Lnet/minecraft/class_5944;method_34588()V
named loadReferences
Lnet/minecraft/client/gl/ShaderProgram;loadReferences()V
-
readSampler
- Mappings:
Namespace Name Mixin selector official a
Lfeg;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/gl/ShaderProgram;readSampler(Lcom/google/gson/JsonElement;)V
-
addSampler
- Mappings:
Namespace Name Mixin selector official a
Lfeg;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/gl/ShaderProgram;addSampler(Ljava/lang/String;Ljava/lang/Object;)V
-
addUniform
- Throws:
InvalidHierarchicalFileException
- Mappings:
Namespace Name Mixin selector official b
Lfeg;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/gl/ShaderProgram;addUniform(Lcom/google/gson/JsonElement;)V
-
getVertexShader
- Specified by:
getVertexShader
in interfaceShaderProgramSetupView
- Mappings:
Namespace Name Mixin selector official c
Ledt;c()Ledr;
intermediary method_1274
Lnet/minecraft/class_3679;method_1274()Lnet/minecraft/class_281;
named getVertexShader
Lnet/minecraft/client/gl/ShaderProgramSetupView;getVertexShader()Lnet/minecraft/client/gl/ShaderStage;
-
getFragmentShader
- Specified by:
getFragmentShader
in interfaceShaderProgramSetupView
- Mappings:
Namespace Name Mixin selector official d
Ledt;d()Ledr;
intermediary method_1278
Lnet/minecraft/class_3679;method_1278()Lnet/minecraft/class_281;
named getFragmentShader
Lnet/minecraft/client/gl/ShaderProgramSetupView;getFragmentShader()Lnet/minecraft/client/gl/ShaderStage;
-
attachReferencedShaders
public void attachReferencedShaders()- Specified by:
attachReferencedShaders
in interfaceShaderProgramSetupView
- Mappings:
Namespace Name Mixin selector official e
Ledt;e()V
intermediary method_34418
Lnet/minecraft/class_3679;method_34418()V
named attachReferencedShaders
Lnet/minecraft/client/gl/ShaderProgramSetupView;attachReferencedShaders()V
-
getFormat
- Mappings:
Namespace Name Mixin selector official h
Lfeg;h()Leei;
intermediary method_35786
Lnet/minecraft/class_5944;method_35786()Lnet/minecraft/class_293;
named getFormat
Lnet/minecraft/client/gl/ShaderProgram;getFormat()Lnet/minecraft/client/render/VertexFormat;
-
getName
- Mappings:
Namespace Name Mixin selector official i
Lfeg;i()Ljava/lang/String;
intermediary method_35787
Lnet/minecraft/class_5944;method_35787()Ljava/lang/String;
named getName
Lnet/minecraft/client/gl/ShaderProgram;getName()Ljava/lang/String;
-
getGlRef
public int getGlRef()- Specified by:
getGlRef
in interfaceShaderProgramSetupView
- Mappings:
Namespace Name Mixin selector official a
Ledt;a()I
intermediary method_1270
Lnet/minecraft/class_3679;method_1270()I
named getGlRef
Lnet/minecraft/client/gl/ShaderProgramSetupView;getGlRef()I
-