Package net.minecraft.client.shader
Class ShaderInstance
- java.lang.Object
-
- net.minecraft.client.shader.ShaderInstance
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,IShaderManager
public class ShaderInstance extends java.lang.Object implements IShaderManager, java.lang.AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
attributeNames
private java.util.List<java.lang.Integer>
attributes
private JSONBlendingMode
blend
private boolean
dirty
private static ShaderDefault
DUMMY_UNIFORM
private ShaderLoader
fragmentProgram
private static ShaderInstance
lastAppliedEffect
private static int
lastProgramId
private static org.apache.logging.log4j.Logger
LOGGER
private java.lang.String
name
private int
programId
private java.util.List<java.lang.Integer>
samplerLocations
private java.util.Map<java.lang.String,java.util.function.IntSupplier>
samplerMap
private java.util.List<java.lang.String>
samplerNames
private java.util.List<java.lang.Integer>
uniformLocations
private java.util.Map<java.lang.String,ShaderUniform>
uniformMap
private java.util.List<ShaderUniform>
uniforms
private ShaderLoader
vertexProgram
-
Constructor Summary
Constructors Constructor Description ShaderInstance(IResourceManager p_i50988_1_, java.lang.String p_i50988_2_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply()
void
clear()
void
close()
ShaderLoader
getFragmentProgram()
int
getId()
static ShaderLoader
getOrCreate(IResourceManager p_216542_0_, ShaderLoader.ShaderType p_216542_1_, java.lang.String p_216542_2_)
ShaderUniform
getUniform(java.lang.String p_216539_1_)
ShaderLoader
getVertexProgram()
void
markDirty()
static JSONBlendingMode
parseBlendNode(com.google.gson.JsonObject p_216543_0_)
private void
parseSamplerNode(com.google.gson.JsonElement p_216541_1_)
private void
parseUniformNode(com.google.gson.JsonElement p_216540_1_)
ShaderDefault
safeGetUniform(java.lang.String p_216538_1_)
void
setSampler(java.lang.String p_216537_1_, java.util.function.IntSupplier p_216537_2_)
private void
updateLocations()
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
DUMMY_UNIFORM
private static final ShaderDefault DUMMY_UNIFORM
-
lastAppliedEffect
private static ShaderInstance lastAppliedEffect
-
lastProgramId
private static int lastProgramId
-
samplerMap
private final java.util.Map<java.lang.String,java.util.function.IntSupplier> samplerMap
-
samplerNames
private final java.util.List<java.lang.String> samplerNames
-
samplerLocations
private final java.util.List<java.lang.Integer> samplerLocations
-
uniforms
private final java.util.List<ShaderUniform> uniforms
-
uniformLocations
private final java.util.List<java.lang.Integer> uniformLocations
-
uniformMap
private final java.util.Map<java.lang.String,ShaderUniform> uniformMap
-
programId
private final int programId
-
name
private final java.lang.String name
-
dirty
private boolean dirty
-
blend
private final JSONBlendingMode blend
-
attributes
private final java.util.List<java.lang.Integer> attributes
-
attributeNames
private final java.util.List<java.lang.String> attributeNames
-
vertexProgram
private final ShaderLoader vertexProgram
-
fragmentProgram
private final ShaderLoader fragmentProgram
-
-
Constructor Detail
-
ShaderInstance
public ShaderInstance(IResourceManager p_i50988_1_, java.lang.String p_i50988_2_) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getOrCreate
public static ShaderLoader getOrCreate(IResourceManager p_216542_0_, ShaderLoader.ShaderType p_216542_1_, java.lang.String p_216542_2_) throws java.io.IOException
- Throws:
java.io.IOException
-
parseBlendNode
public static JSONBlendingMode parseBlendNode(com.google.gson.JsonObject p_216543_0_)
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
clear
public void clear()
-
apply
public void apply()
-
markDirty
public void markDirty()
- Specified by:
markDirty
in interfaceIShaderManager
-
getUniform
@Nullable public ShaderUniform getUniform(java.lang.String p_216539_1_)
-
safeGetUniform
public ShaderDefault safeGetUniform(java.lang.String p_216538_1_)
-
updateLocations
private void updateLocations()
-
parseSamplerNode
private void parseSamplerNode(com.google.gson.JsonElement p_216541_1_)
-
setSampler
public void setSampler(java.lang.String p_216537_1_, java.util.function.IntSupplier p_216537_2_)
-
parseUniformNode
private void parseUniformNode(com.google.gson.JsonElement p_216540_1_) throws JSONException
- Throws:
JSONException
-
getVertexProgram
public ShaderLoader getVertexProgram()
- Specified by:
getVertexProgram
in interfaceIShaderManager
-
getFragmentProgram
public ShaderLoader getFragmentProgram()
- Specified by:
getFragmentProgram
in interfaceIShaderManager
-
getId
public int getId()
- Specified by:
getId
in interfaceIShaderManager
-
-