public class ShaderManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.Integer> |
attribLocations |
private java.util.List<java.lang.String> |
attributes |
private JsonBlendingMode |
blendingMode |
private static int |
currentProgram |
private static ShaderDefault |
DEFAULT_SHADER_UNIFORM |
private ShaderLoader |
fragmentShaderLoader |
private boolean |
isDirty |
private static boolean |
lastCull |
private static org.apache.logging.log4j.Logger |
LOGGER |
private java.util.Map<java.lang.String,ShaderUniform> |
mappedShaderUniforms |
private int |
program |
private java.lang.String |
programFilename |
private java.util.List<java.lang.String> |
samplerNames |
private java.util.List<java.lang.Integer> |
shaderSamplerLocations |
private java.util.Map<java.lang.String,java.lang.Object> |
shaderSamplers |
private java.util.List<java.lang.Integer> |
shaderUniformLocations |
private java.util.List<ShaderUniform> |
shaderUniforms |
private static ShaderManager |
staticShaderManager |
private boolean |
useFaceCulling |
private ShaderLoader |
vertexShaderLoader |
Constructor and Description |
---|
ShaderManager(IResourceManager resourceManager,
java.lang.String programName) |
Modifier and Type | Method and Description |
---|---|
void |
addSamplerTexture(java.lang.String name,
java.lang.Object samplerTexture) |
void |
deleteShader() |
void |
endShader() |
ShaderLoader |
getFragmentShaderLoader() |
int |
getProgram() |
ShaderUniform |
getShaderUniform(java.lang.String name) |
ShaderUniform |
getShaderUniformOrDefault(java.lang.String name) |
ShaderLoader |
getVertexShaderLoader() |
void |
markDirty() |
private void |
parseSampler(com.google.gson.JsonElement element) |
private void |
parseUniform(com.google.gson.JsonElement element) |
private void |
setupUniforms() |
void |
useShader() |
private static final org.apache.logging.log4j.Logger LOGGER
private static final ShaderDefault DEFAULT_SHADER_UNIFORM
private static ShaderManager staticShaderManager
private static int currentProgram
private static boolean lastCull
private final java.util.Map<java.lang.String,java.lang.Object> shaderSamplers
private final java.util.List<java.lang.String> samplerNames
private final java.util.List<java.lang.Integer> shaderSamplerLocations
private final java.util.List<ShaderUniform> shaderUniforms
private final java.util.List<java.lang.Integer> shaderUniformLocations
private final java.util.Map<java.lang.String,ShaderUniform> mappedShaderUniforms
private final int program
private final java.lang.String programFilename
private final boolean useFaceCulling
private boolean isDirty
private final JsonBlendingMode blendingMode
private final java.util.List<java.lang.Integer> attribLocations
private final java.util.List<java.lang.String> attributes
private final ShaderLoader vertexShaderLoader
private final ShaderLoader fragmentShaderLoader
public ShaderManager(IResourceManager resourceManager, java.lang.String programName) throws JsonException, java.io.IOException
JsonException
java.io.IOException
public void deleteShader()
public void endShader()
public void useShader()
public void markDirty()
@Nullable public ShaderUniform getShaderUniform(java.lang.String name)
public ShaderUniform getShaderUniformOrDefault(java.lang.String name)
private void setupUniforms()
private void parseSampler(com.google.gson.JsonElement element) throws JsonException
JsonException
public void addSamplerTexture(java.lang.String name, java.lang.Object samplerTexture)
private void parseUniform(com.google.gson.JsonElement element) throws JsonException
JsonException
public ShaderLoader getVertexShaderLoader()
public ShaderLoader getFragmentShaderLoader()
public int getProgram()