java.lang.Object
de.grogra.glsl.utility.GLSLShader
- All Implemented Interfaces:
GLSLOpenGLObject
- Direct Known Subclasses:
GLSLManagedShader
Base for all complete shaders like
- Author:
- Konni Hartmann
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateShader(OpenGLState glState, GLSLDisplay disp, Object data) Only public method.voidcleanup(OpenGLState glState, boolean javaonly) voiddeleteShader(javax.media.opengl.GL gl, boolean javaonly) Remove OpenGL side of this shaderprotected abstract String[]getFragmentShader(Object data) For "hardcompiled" Shaders this method should return a new instanceintGetter for Shader Programnumberprotected String[]getVertexShader(Object data) booleanneedsRecompilation(Object data) Return false if Shader depends only on Uniformsprotected static voidprintProgramInfoLog(javax.media.opengl.GL gl, int program) Same asprintShaderInfoLogonly for Programs.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 data)
-
Constructor Details
-
GLSLShader
-
-
Method Details
-
printProgramInfoLog
protected static void printProgramInfoLog(javax.media.opengl.GL gl, int program) Same asprintShaderInfoLogonly for Programs.- Parameters:
gl-program-
-
getShaderProgramNumber
public int getShaderProgramNumber()Getter for Shader Programnumber- Returns:
- the OpenGL id of the associated shader-program-id
-
needsRecompilation
Return false if Shader depends only on Uniforms- Parameters:
s- Associated Shader- Returns:
- true, if Sourcecode needs to be regenerated and recompiled
-
instanceFor
- Returns:
- Class represented by this Shader
-
getInstance
For "hardcompiled" Shaders this method should return a new instance- Returns:
-
getVertexShader
- Parameters:
sh-- Returns:
-
getFragmentShader
- Parameters:
sh-- Returns:
-
setupDynamicUniforms
protected void setupDynamicUniforms(javax.media.opengl.GL gl, GLSLDisplay disp, Object data, int shaderNo) Function that loads uniforms of the represented Shader.- Parameters:
gl-disp- GLSLDisplay that tries using this shaderdata- The GroIMP-Shader-Object represented by this shader.
-
setupShader
- Parameters:
gl-disp-s-
-
activateShader
Only public method. Use this to activate (and compile) this Shader for use in rendering.- Parameters:
disp-gl-sh-s-
-
deleteShader
public void deleteShader(javax.media.opengl.GL gl, boolean javaonly) Remove OpenGL side of this shader- Parameters:
gl-
-
cleanup
- Specified by:
cleanupin interfaceGLSLOpenGLObject
-