java.lang.Object
de.grogra.glsl.utility.GLSLShader
de.grogra.glsl.utility.GLSLManagedShader
de.grogra.glsl.material.GLSLMaterial
de.grogra.glsl.material.GLSLSideSwitchShader
- All Implemented Interfaces:
GLSLOpenGLObject
Implementation of Shader: SideSwitch. Will recompile on every property change!
- Author:
- Konni Hartmann
-
Field Summary
Fields inherited from class de.grogra.glsl.utility.GLSLManagedShader
config
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Result[]
getAllChannels
(Object sha) For "hardcompiled" Shaders this method should return a new instanceboolean
boolean
mayDiscard
(Object s) boolean
Return false if Shader depends only on Uniformsprotected void
setupDynamicUniforms
(javax.media.opengl.GL gl, GLSLDisplay disp, Object data, int shaderNo) Function that loads uniforms of the represented Shader.protected void
setupUniforms
(javax.media.opengl.GL gl, GLSLDisplay disp, Object s, int shaderProgramNumber) Function that loads uniforms of the represented Shader.void
Methods inherited from class de.grogra.glsl.material.GLSLMaterial
getFragmentShader, setupShader
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, getShaderProgramNumber, getVertexShader, printProgramInfoLog
-
Constructor Details
-
GLSLSideSwitchShader
public GLSLSideSwitchShader()
-
-
Method Details
-
getAllChannels
- Specified by:
getAllChannels
in classGLSLMaterial
-
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 classGLSLMaterial
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) Description copied from class:GLSLMaterial
Function that loads uniforms of the represented Shader. Called byGLSLMaterial.setupShader(GL, GLSLDisplay, Object)
. Use this to add special uniforms instead of overloadingGLSLMaterial.setupShader(GL, GLSLDisplay, Object)
. Used by SideSwitchShader to initialize both shaders.- Overrides:
setupUniforms
in classGLSLMaterial
disp
- GLSLDisplay that tries using this shaders
- The GroIMP-Shader-Object represented by this shader.
-
instanceFor
- Overrides:
instanceFor
in classGLSLShader
- Returns:
- Class represented by this Shader
-
needsRecompilation
Description copied from class:GLSLShader
Return false if Shader depends only on Uniforms- Overrides:
needsRecompilation
in classGLSLShader
- Returns:
- true, if Sourcecode needs to be regenerated and recompiled
-
getInstance
Description copied from class:GLSLShader
For "hardcompiled" Shaders this method should return a new instance- Overrides:
getInstance
in classGLSLShader
- Returns:
-
mayDiscard
- Overrides:
mayDiscard
in classGLSLMaterial
- Parameters:
s
- GroImp Shader that acts as a base for this shader- Returns:
- True, if fragments may be discarded by this shader
-
isOpaque
- Overrides:
isOpaque
in classGLSLMaterial
-
updateShaderRefs
-