Class ShaderUtil

java.lang.Object
com.jogamp.opengl.util.glsl.ShaderUtil

public class ShaderUtil extends Object
  • Constructor Details

    • ShaderUtil

      public ShaderUtil()
  • Method Details

    • getShaderInfoLog

      public static String getShaderInfoLog(GL _gl, int shaderObj)
    • getProgramInfoLog

      public static String getProgramInfoLog(GL _gl, int programObj)
    • isShaderStatusValid

      public static boolean isShaderStatusValid(GL _gl, int shaderObj, int name, PrintStream verboseOut)
    • isShaderStatusValid

      public static boolean isShaderStatusValid(GL _gl, IntBuffer shaders, int name, PrintStream verboseOut)
    • isProgramStatusValid

      public static boolean isProgramStatusValid(GL _gl, int programObj, int name)
    • isProgramLinkStatusValid

      public static boolean isProgramLinkStatusValid(GL _gl, int programObj, PrintStream verboseOut)
    • isProgramExecStatusValid

      public static boolean isProgramExecStatusValid(GL _gl, int programObj, PrintStream verboseOut)
      Performs GL2ES2.glValidateProgram(int)

      One shall only call this method while debugging and only if all required resources by the shader are set.

      Note: It is possible that a working shader program will fail validation. This has been experienced on NVidia APX2500 and Tegra2.

      See Also:
    • createShader

      public static void createShader(GL _gl, int type, IntBuffer shaders)
    • getShaderBinaryFormats

      public static Set<Integer> getShaderBinaryFormats(GL _gl)
      If supported, queries the natively supported shader binary formats using GL2ES2.GL_NUM_SHADER_BINARY_FORMATS and GL2ES2.GL_SHADER_BINARY_FORMATS via GL.glGetIntegerv(int, int[], int).
    • isShaderCompilerAvailable

      public static boolean isShaderCompilerAvailable(GL _gl)
      Returns true if a hader compiler is available, otherwise false.
    • isGeometryShaderSupported

      public static boolean isGeometryShaderSupported(GL _gl)
      Returns true if GeometryShader is supported, i.e. whether GLContext is ≥ 3.2 or ARB_geometry_shader4 extension is available.
    • shaderSource

      public static void shaderSource(GL _gl, int shader, CharSequence[] source)
    • shaderSource

      public static void shaderSource(GL _gl, IntBuffer shaders, CharSequence[][] sources)
    • shaderBinary

      public static void shaderBinary(GL _gl, IntBuffer shaders, int binFormat, Buffer bin)
    • compileShader

      public static void compileShader(GL _gl, IntBuffer shaders)
    • attachShader

      public static void attachShader(GL _gl, int program, IntBuffer shaders)
    • detachShader

      public static void detachShader(GL _gl, int program, IntBuffer shaders)
    • deleteShader

      public static void deleteShader(GL _gl, IntBuffer shaders)
    • createAndLoadShader

      public static boolean createAndLoadShader(GL _gl, IntBuffer shader, int shaderType, int binFormat, Buffer bin, PrintStream verboseOut)
    • createAndCompileShader

      public static boolean createAndCompileShader(GL _gl, IntBuffer shader, int shaderType, CharSequence[][] sources, PrintStream verboseOut)