Class TessellationShaderProgram

java.lang.Object
gaiasky.util.gdx.shader.ExtShaderProgram
gaiasky.util.gdx.shader.TessellationShaderProgram
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public class TessellationShaderProgram extends ExtShaderProgram
  • Field Details

    • prependControlCode

      public static String prependControlCode
      Code that is always added to the tessellation shaders, typically used to inject a #version line. Note that this is added as-is, you should include a newline (`\n`) if needed.
    • prependEvaluationCode

      public static String prependEvaluationCode
    • controlShaderFile

      protected String controlShaderFile
    • evaluationShaderFile

      protected String evaluationShaderFile
  • Constructor Details

    • TessellationShaderProgram

      public TessellationShaderProgram(String vertexShaderCode, String controlShaderCode, String evaluationShaderCode, String fragmentShaderCode)
    • TessellationShaderProgram

      public TessellationShaderProgram(String name, String vertexFile, String tessControlFile, String tessEvaluationFile, String fragmentFile, String vertexShaderCode, String controlShaderCode, String evaluationShaderCode, String fragmentShaderCode, boolean lazyLoading)
      Constructs a new shader program and immediately compiles it, if it is not lazy.
      Parameters:
      name - The shader name, if any.
      vertexFile - The vertex shader file.
      tessControlFile - The tessellation control shader file.
      tessEvaluationFile - The tessellation evaluation shader file.
      fragmentFile - The fragment shader file.
      vertexShaderCode - The vertex shader code.
      controlShaderCode - The tessellation control shader code.
      evaluationShaderCode - The tessellation evaluation shader code.
      fragmentShaderCode - The fragment shader code.
      lazyLoading - Whether to use lazy loading, only preparing the data without actually compiling the shaders.
  • Method Details

    • compile

      public void compile()
      Overrides:
      compile in class ExtShaderProgram
    • invalidateAllShaderPrograms

      public static void invalidateAllShaderPrograms(com.badlogic.gdx.Application app)
      Invalidates all shaders so the next time they are used new handles are generated
    • clearAllShaderPrograms

      public static void clearAllShaderPrograms(com.badlogic.gdx.Application app)
    • getManagedStatus

      public static String getManagedStatus()
    • getNumManagedShaderPrograms

      public static int getNumManagedShaderPrograms()
      Returns:
      the number of managed shader programs currently loaded
    • getControlShaderSource

      public String getControlShaderSource()
    • getControlShaderFileName

      public String getControlShaderFileName()
    • getEvaluationShaderSource

      public String getEvaluationShaderSource()
    • getEvaluationShaderFileName

      public String getEvaluationShaderFileName()
    • dispose

      public void dispose()
      Description copied from class: ExtShaderProgram
      Disposes all resources associated with this shader. Must be called when the shader is no longer used.
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
      Overrides:
      dispose in class ExtShaderProgram