de.grogra.imp3d.glsl.material
Class GLSLSideSwitchShader

java.lang.Object
  extended by de.grogra.imp3d.glsl.utility.GLSLShader
      extended by de.grogra.imp3d.glsl.utility.GLSLManagedShader
          extended by de.grogra.imp3d.glsl.material.GLSLMaterial
              extended by de.grogra.imp3d.glsl.material.GLSLSideSwitchShader
All Implemented Interfaces:
GLSLOpenGLObject

public class GLSLSideSwitchShader
extends GLSLMaterial

Implementation of Shader: SideSwitch. Will recompile on every property change!

Author:
Konni Hartmann

Field Summary
 
Fields inherited from class de.grogra.imp3d.glsl.utility.GLSLManagedShader
config
 
Constructor Summary
GLSLSideSwitchShader()
           
 
Method Summary
protected  Result[] getAllChannels(java.lang.Object sha)
           
 GLSLManagedShader getInstance()
          For "hardcompiled" Shaders this method should return a new instance
 java.lang.Class instanceFor()
           
 boolean isOpaque(java.lang.Object s)
           
 boolean mayDiscard(java.lang.Object s)
           
 boolean needsRecompilation(java.lang.Object s)
          Return false if Shader depends only on Uniforms
protected  void setupDynamicUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, java.lang.Object data, int shaderNo)
          Function that loads uniforms of the represented Shader.
protected  void setupUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, java.lang.Object s, int shaderProgramNumber)
          Function that loads uniforms of the represented Shader.
 void updateShaderRefs(SideSwitchShader s)
           
 
Methods inherited from class de.grogra.imp3d.glsl.material.GLSLMaterial
getFragmentShader, setupShader
 
Methods inherited from class de.grogra.imp3d.glsl.utility.GLSLManagedShader
deleteShader, getConfig, getMaterial_stamp, setConfig, setMaterial_stamp
 
Methods inherited from class de.grogra.imp3d.glsl.utility.GLSLShader
activateShader, cleanup, getShaderProgramNumber, getVertexShader, printProgramInfoLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLSLSideSwitchShader

public GLSLSideSwitchShader()
Method Detail

getAllChannels

protected Result[] getAllChannels(java.lang.Object sha)
Specified by:
getAllChannels in class GLSLMaterial

getInstance

public GLSLManagedShader getInstance()
Description copied from class: GLSLShader
For "hardcompiled" Shaders this method should return a new instance

Overrides:
getInstance in class GLSLShader
Returns:

instanceFor

public java.lang.Class instanceFor()
Overrides:
instanceFor in class GLSLShader
Returns:
Class represented by this Shader

isOpaque

public boolean isOpaque(java.lang.Object s)
Overrides:
isOpaque in class GLSLMaterial

mayDiscard

public boolean mayDiscard(java.lang.Object s)
Overrides:
mayDiscard in class GLSLMaterial
Parameters:
s - GroImp Shader that acts as a base for this shader
Returns:
True, if fragments may be discarded by this shader

needsRecompilation

public boolean needsRecompilation(java.lang.Object s)
Description copied from class: GLSLShader
Return false if Shader depends only on Uniforms

Overrides:
needsRecompilation in class GLSLShader
Returns:
true, if Sourcecode needs to be regenerated and recompiled

setupDynamicUniforms

protected void setupDynamicUniforms(javax.media.opengl.GL gl,
                                    GLSLDisplay disp,
                                    java.lang.Object data,
                                    int shaderNo)
Description copied from class: GLSLShader
Function that loads uniforms of the represented Shader.

Overrides:
setupDynamicUniforms in class GLSLMaterial
disp - GLSLDisplay that tries using this shader
data - The GroIMP-Shader-Object represented by this shader.

setupUniforms

protected void setupUniforms(javax.media.opengl.GL gl,
                             GLSLDisplay disp,
                             java.lang.Object s,
                             int shaderProgramNumber)
Description copied from class: GLSLMaterial
Function that loads uniforms of the represented Shader. Called by GLSLMaterial.setupShader(GL, GLSLDisplay, Object). Use this to add special uniforms instead of overloading GLSLMaterial.setupShader(GL, GLSLDisplay, Object). Used by SideSwitchShader to initialize both shaders.

Overrides:
setupUniforms in class GLSLMaterial
disp - GLSLDisplay that tries using this shader
s - The GroIMP-Shader-Object represented by this shader.

updateShaderRefs

public void updateShaderRefs(SideSwitchShader s)