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
-
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.boolean
boolean
mayDiscard
(Object s) protected void
setupDynamicUniforms
(javax.media.opengl.GL gl, GLSLDisplay disp, Object data, int shaderNo) Function that loads uniforms of the represented Shader.protected void
setupShader
(javax.media.opengl.GL gl, GLSLDisplay disp, Object s) protected void
setupUniforms
(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_stamp
Methods 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:GLSLShader
Function that loads uniforms of the represented Shader.- Overrides:
setupDynamicUniforms
in classGLSLShader
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:
setupShader
in classGLSLShader
-
getAllChannels
-
getFragmentShader
Generate the FragmentShaderCode by using the configuration of the Shader.- Specified by:
getFragmentShader
in 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
-