java.lang.Object
com.luciad.view.lightspeed.util.opengl.glsl.TLspShader

public class TLspShader extends Object
A shader can be a vertex, geometry or fragment shader.
Since:
2012.0
  • Method Details

    • getSources

      public List<String> getSources()
      Gets the paths to the source files that were used to create the shader. Can be null and empty.
      Returns:
      the paths to the source files that were used to create the shader
    • createVertexShader

      public static TLspShader createVertexShader(ILcdGL aGL, String aSource) throws IOException
      Creates a vertex shader from the given source file.
      Parameters:
      aGL - the ILcdGL object
      aSource - the full path to the source file
      Returns:
      a new shader object for the given source file
      Throws:
      IOException - when the source file cannot be read
    • createVertexShader

      public static TLspShader createVertexShader(ILcdGL aGL, String[] aSources) throws IOException
      Creates a vertex shader from the given source files.
      Parameters:
      aGL - the ILcdGL object
      aSources - the full paths to the source files
      Returns:
      a new shader object for the given source files
      Throws:
      IOException - when the source files cannot be read
    • createVertexShaderFromSourceCode

      public static TLspShader createVertexShaderFromSourceCode(ILcdGL aGL, String[] aSourceCode)
      Creates a vertex shader from the given source code chunks.
      Parameters:
      aGL - the ILcdGL object
      aSourceCode - the source code chunks
      Returns:
      a new shader object for the given source code=
    • createFragmentShader

      public static TLspShader createFragmentShader(ILcdGL aGL, String aSource) throws IOException
      Creates a fragment shader from the given source file.
      Parameters:
      aGL - the ILcdGL object
      aSource - the full path to the source file
      Returns:
      a new shader object for the given source file
      Throws:
      IOException - when the source file cannot be read
    • createFragmentShader

      public static TLspShader createFragmentShader(ILcdGL aGL, String[] aSources) throws IOException
      Creates a fragment shader from the given source files.
      Parameters:
      aGL - the ILcdGL object
      aSources - the full paths to the source files
      Returns:
      a new shader object for the given source files
      Throws:
      IOException - when the source files cannot be read
    • createFragmentShaderFromSourceCode

      public static TLspShader createFragmentShaderFromSourceCode(ILcdGL aGL, String[] aSourceCode)
      Creates a fragment shader from the given source code chunks.
      Parameters:
      aGL - the ILcdGL object
      aSourceCode - the source code chunks
      Returns:
      a new shader object for the given source code=
    • createGeometryShader

      public static TLspShader createGeometryShader(ILcdGL aGL, String aSource) throws IOException
      Creates a geometry shader from the given source file.
      Parameters:
      aGL - the ILcdGL object
      aSource - the full path to the source file
      Returns:
      a new shader object for the given source file
      Throws:
      IOException - when the source file cannot be read
    • createGeometryShader

      public static TLspShader createGeometryShader(ILcdGL aGL, String[] aSources) throws IOException
      Creates a geometry shader from the given source files.
      Parameters:
      aGL - the ILcdGL object
      aSources - the full paths to the source files
      Returns:
      a new shader object for the given source files
      Throws:
      IOException - when the source files cannot be read
    • getID

      public int getID()
      Gets the OpenGL ID of the shader.
      Returns:
      the shader's OpenGL ID
    • getType

      public TLspShader.ShaderType getType()
      Gets the type of shader.
      Returns:
      the shader type
    • destroy

      public void destroy(ILcdGL aGL)
      Destroys the shader making it invalid to use.
      Parameters:
      aGL - the ILcdGL object