Package gaiasky.util.gdx.shader
Class TessellationShaderProgram
java.lang.Object
gaiasky.util.gdx.shader.ExtShaderProgram
gaiasky.util.gdx.shader.TessellationShaderProgram
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected String
static String
Code that is always added to the tessellation shaders, typically used to inject a #version line.static String
Fields inherited from class gaiasky.util.gdx.shader.ExtShaderProgram
attributeNames, attributes, attributeSizes, attributeTypes, byteBuffer, COLOR_ATTRIBUTE, format, fragmentShaderFile, fragmentShaderHandle, fragmentShaderSource, geometryShaderFile, geometryShaderSource, intBuffer, invalidated, isCompiled, isDisposed, isLazy, len, log, name, NORMAL_ATTRIBUTE, params, pedantic, POSITION_ATTRIBUTE, prependFragmentCode, prependGeometryCode, prependVertexCode, program, TEXCOORD_ATTRIBUTE, type, uniformNames, uniforms, uniformSizes, uniformTypes, vertexShaderFile, vertexShaderHandle, vertexShaderSource
-
Constructor Summary
ConstructorDescriptionTessellationShaderProgram
(String vertexShaderCode, String controlShaderCode, String evaluationShaderCode, String fragmentShaderCode) TessellationShaderProgram
(String name, String vertexFile, String tessControlFile, String tessEvaluationFile, String fragmentFile, String vertexShaderCode, String controlShaderCode, String evaluationShaderCode, String fragmentShaderCode, boolean lazyLoading) Constructs a new shader program and immediately compiles it, if it is not lazy. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clearAllShaderPrograms
(com.badlogic.gdx.Application app) void
compile()
void
dispose()
Disposes all resources associated with this shader.static String
static int
static void
invalidateAllShaderPrograms
(com.badlogic.gdx.Application app) Invalidates all shaders so the next time they are used new handles are generatedvoid
Methods inherited from class gaiasky.util.gdx.shader.ExtShaderProgram
begin, compile, disableVertexAttribute, disableVertexAttribute, enableVertexAttribute, enableVertexAttribute, end, fetchAttributeLocation, fetchAttributes, fetchUniformLocation, fetchUniformLocation, fetchUniforms, getAttributeLocation, getAttributes, getAttributeSize, getAttributeType, getFragmentShaderFileName, getFragmentShaderSource, getGeometryShaderFileName, getGeometryShaderSource, getLog, getName, getUniformLocation, getUniforms, getUniformSize, getUniformType, getVertexShaderFileName, getVertexShaderSource, hasAttribute, hasUniform, initializeLocalAssets, isCompiled, isLazy, setAttributef, setUniform1fv, setUniform1fv, setUniform2fv, setUniform2fv, setUniform3fv, setUniform3fv, setUniform4fv, setUniform4fv, setUniformf, setUniformf, setUniformf, setUniformf, setUniformf, setUniformf, setUniformf, setUniformf, setUniformf, setUniformf, setUniformf, setUniformf, setUniformf, setUniformf, setUniformi, setUniformi, setUniformi, setUniformi, setUniformi, setUniformi, setUniformi, setUniformi, setUniformMatrix, setUniformMatrix, setUniformMatrix, setUniformMatrix, setUniformMatrix, setUniformMatrix, setUniformMatrix, setUniformMatrix, setUniformMatrix3fv, setUniformMatrix4fv, setUniformMatrix4fv, setUniformMatrix4fv, setVertexAttribute, setVertexAttribute, setVertexAttribute, setVertexAttribute, writeShader
-
Field Details
-
prependControlCode
Code that is always added to the tessellation shaders, typically used to inject a #version line. Note that this is added as-is, you should include a newline (`\n`) if needed. -
prependEvaluationCode
-
controlShaderFile
-
evaluationShaderFile
-
-
Constructor Details
-
TessellationShaderProgram
-
TessellationShaderProgram
public TessellationShaderProgram(String name, String vertexFile, String tessControlFile, String tessEvaluationFile, String fragmentFile, String vertexShaderCode, String controlShaderCode, String evaluationShaderCode, String fragmentShaderCode, boolean lazyLoading) Constructs a new shader program and immediately compiles it, if it is not lazy.- Parameters:
name
- The shader name, if any.vertexFile
- The vertex shader file.tessControlFile
- The tessellation control shader file.tessEvaluationFile
- The tessellation evaluation shader file.fragmentFile
- The fragment shader file.vertexShaderCode
- The vertex shader code.controlShaderCode
- The tessellation control shader code.evaluationShaderCode
- The tessellation evaluation shader code.fragmentShaderCode
- The fragment shader code.lazyLoading
- Whether to use lazy loading, only preparing the data without actually compiling the shaders.
-
-
Method Details
-
compile
public void compile() -
invalidateAllShaderPrograms
public static void invalidateAllShaderPrograms(com.badlogic.gdx.Application app) Invalidates all shaders so the next time they are used new handles are generated -
clearAllShaderPrograms
public static void clearAllShaderPrograms(com.badlogic.gdx.Application app) -
getManagedStatus
-
getNumManagedShaderPrograms
public static int getNumManagedShaderPrograms()- Returns:
- the number of managed shader programs currently loaded
-
getControlShaderSource
-
getControlShaderFileName
-
getEvaluationShaderSource
-
getEvaluationShaderFileName
-
dispose
public void dispose()Description copied from class:ExtShaderProgram
Disposes all resources associated with this shader. Must be called when the shader is no longer used.- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classExtShaderProgram
-
writeShaders
public void writeShaders()- Overrides:
writeShaders
in classExtShaderProgram
-