Module gl1

Class GLSLMaterial

All Implemented Interfaces:
GLSLOpenGLObject
Direct Known Subclasses:
GLSLPhong, GLSLRGBAShader, GLSLSideSwitchShader, GLSLSunSky

public abstract class GLSLMaterial extends GLSLManagedShader
Represents a class of Shaders that need to be recompiled for every property change. (e.g GLSLPhong)
Author:
Konni Hartmann
  • 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 class GLSLShader
      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, Object s, int shaderProgramNumber)
      Function that loads uniforms of the represented Shader. Called by setupShader(GL, GLSLDisplay, Object). Use this to add special uniforms instead of overloading setupShader(GL, GLSLDisplay, Object). Used by SideSwitchShader to initialize both shaders.
      Parameters:
      gl -
      disp - GLSLDisplay that tries using this shader
      s - The GroIMP-Shader-Object represented by this shader.
    • setupShader

      protected void setupShader(javax.media.opengl.GL gl, GLSLDisplay disp, Object s)
      Overrides:
      setupShader in class GLSLShader
    • getAllChannels

      protected abstract Result[] getAllChannels(Object sha)
    • getFragmentShader

      protected String[] getFragmentShader(Object sha)
      Generate the FragmentShaderCode by using the configuration of the Shader.
      Specified by:
      getFragmentShader in class GLSLShader
      Returns:
    • mayDiscard

      public boolean mayDiscard(Object s)
      Parameters:
      s - GroImp Shader that acts as a base for this shader
      Returns:
      True, if fragments may be discarded by this shader
    • isOpaque

      public boolean isOpaque(Object s)