java.lang.Object
de.grogra.glsl.utility.GLSLShader
de.grogra.glsl.utility.GLSLManagedShader
de.grogra.glsl.material.GLSLMaterial
- All Implemented Interfaces:
GLSLOpenGLObject
- Direct Known Subclasses:
GLSLPhong,GLSLRGBAShader,GLSLSideSwitchShader,GLSLSunSky
Represents a class of Shaders that need to be recompiled for every property
change. (e.g GLSLPhong)
- Author:
- Konni Hartmann
-
Field Summary
Fields inherited from class de.grogra.glsl.utility.GLSLManagedShader
config -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Result[]getAllChannels(Object sha) protected String[]getFragmentShader(Object sha) Generate the FragmentShaderCode by using the configuration of the Shader.booleanbooleanmayDiscard(Object s) protected voidsetupDynamicUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, Object data, int shaderNo) Function that loads uniforms of the represented Shader.protected voidsetupShader(javax.media.opengl.GL gl, GLSLDisplay disp, Object s) protected voidsetupUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, Object s, int shaderProgramNumber) Function that loads uniforms of the represented Shader.Methods inherited from class de.grogra.glsl.utility.GLSLManagedShader
deleteShader, getConfig, getMaterial_stamp, setConfig, setMaterial_stampMethods inherited from class de.grogra.glsl.utility.GLSLShader
activateShader, cleanup, getInstance, getShaderProgramNumber, getVertexShader, instanceFor, needsRecompilation, printProgramInfoLog
-
Constructor Details
-
GLSLMaterial
public GLSLMaterial()
-
-
Method Details
-
setupDynamicUniforms
protected void setupDynamicUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, Object data, int shaderNo) Description copied from class:GLSLShaderFunction that loads uniforms of the represented Shader.- Overrides:
setupDynamicUniformsin classGLSLShader- Parameters:
gl-disp- GLSLDisplay that tries using this shaderdata- The GroIMP-Shader-Object represented by this shader.
-
setupUniforms
protected void setupUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, Object s, int shaderProgramNumber) Function that loads uniforms of the represented Shader. Called bysetupShader(GL, GLSLDisplay, Object). Use this to add special uniforms instead of overloadingsetupShader(GL, GLSLDisplay, Object). Used by SideSwitchShader to initialize both shaders.- Parameters:
gl-disp- GLSLDisplay that tries using this shaders- The GroIMP-Shader-Object represented by this shader.
-
setupShader
- Overrides:
setupShaderin classGLSLShader- Parameters:
gl-disp-
-
getAllChannels
-
getFragmentShader
Generate the FragmentShaderCode by using the configuration of the Shader.- Specified by:
getFragmentShaderin classGLSLShader- Returns:
-
mayDiscard
- Parameters:
s- GroImp Shader that acts as a base for this shader- Returns:
- True, if fragments may be discarded by this shader
-
isOpaque
-