Class BaseIntShader

java.lang.Object
gaiasky.util.gdx.shader.BaseIntShader
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, IntShader
Direct Known Subclasses:
AtmosphereShader, DefaultIntShader

public abstract class BaseIntShader extends Object implements IntShader
  • Field Details Link icon

    • program Link icon

      public ExtShaderProgram program
    • context Link icon

      public com.badlogic.gdx.graphics.g3d.utils.RenderContext context
    • camera Link icon

      public com.badlogic.gdx.graphics.Camera camera
  • Constructor Details Link icon

    • BaseIntShader Link icon

      public BaseIntShader()
  • Method Details Link icon

    • register Link icon

      public int register(String alias, BaseIntShader.Validator validator, BaseIntShader.Setter setter)
      Register an uniform which might be used by this shader. Only possible prior to the call to init().
      Returns:
      The ID of the uniform to use in this shader.
    • register Link icon

      public int register(String alias, BaseIntShader.Validator validator)
    • register Link icon

      public int register(String alias, BaseIntShader.Setter setter)
    • register Link icon

      public int register(String alias)
    • register Link icon

      public int register(BaseIntShader.Uniform uniform, BaseIntShader.Setter setter)
    • register Link icon

      public int register(BaseIntShader.Uniform uniform)
    • getUniformID Link icon

      public int getUniformID(String alias)
      Returns:
      the ID of the input or negative if not available.
    • getUniformAlias Link icon

      public String getUniformAlias(int id)
      Returns:
      The input at the specified id.
    • init Link icon

      public void init(ExtShaderProgram program, IntRenderable renderable)
      Initialize this shader, causing all registered uniforms/attributes to be fetched.
    • begin Link icon

      public void begin(com.badlogic.gdx.graphics.Camera camera, com.badlogic.gdx.graphics.g3d.utils.RenderContext context)
      Description copied from interface: IntShader
      Initializes the context for exclusive rendering by this shader. Use the IntShader.render(IntRenderable) method to render a IntRenderable. When done rendering the IntShader.end() method must be called.
      Specified by:
      begin in interface IntShader
      Parameters:
      camera - The camera to use when rendering
      context - The context to be used, which must be exclusive available for the shader until the call to the IntShader.end() method.
    • render Link icon

      public void render(IntRenderable renderable)
      Description copied from interface: IntShader
      Renders the IntRenderable, must be called between IntShader.begin(Camera, RenderContext) and IntShader.end(). The IntShader instance might not be able to render every type of IntRenderables. Use the IntShader.canRender(IntRenderable) method to check if the IntShader is capable of rendering a specific IntRenderable.
      Specified by:
      render in interface IntShader
      Parameters:
      renderable - The renderable to render, all required fields (e.g. IntRenderable.material and others) must be set. The IntRenderable.shader field will be ignored.
    • render Link icon

      public void render(IntRenderable renderable, Attributes combinedAttributes)
    • renderMesh Link icon

      public void renderMesh(ExtShaderProgram program, IntMeshPart meshPart)
      If necessary, override.
      Parameters:
      program - The shader program.
      meshPart - The mesh part.
    • end Link icon

      public void end()
      Description copied from interface: IntShader
      Cleanup the context so other shaders can render. Must be called when done rendering using the IntShader.render(IntRenderable) method, which must be preceded by a call to IntShader.begin(Camera, RenderContext). After a call to this method an call to the IntShader.render(IntRenderable) method will fail until the IntShader.begin(Camera, RenderContext) is called.
      Specified by:
      end in interface IntShader
    • dispose Link icon

      public void dispose()
      Specified by:
      dispose in interface com.badlogic.gdx.utils.Disposable
    • has Link icon

      public final boolean has(int inputID)
      Whether this IntShader instance implements the specified uniform, only valid after a call to init().
    • loc Link icon

      public final int loc(int inputID)
    • set Link icon

      public final boolean set(int uniform, com.badlogic.gdx.math.Matrix4 value)
    • set Link icon

      public final boolean set(int uniform, com.badlogic.gdx.math.Matrix3 value)
    • set Link icon

      public final boolean set(int uniform, com.badlogic.gdx.math.Vector3 value)
    • set Link icon

      public final boolean set(int uniform, com.badlogic.gdx.math.Vector2 value)
    • set Link icon

      public final boolean set(int uniform, com.badlogic.gdx.graphics.Color value)
    • set Link icon

      public final boolean set(int uniform, float value)
    • set Link icon

      public final boolean set(int uniform, float v1, float v2)
    • set Link icon

      public final boolean set(int uniform, float v1, float v2, float v3)
    • set Link icon

      public final boolean set(int uniform, float v1, float v2, float v3, float v4)
    • set Link icon

      public final boolean set(int uniform, int value)
    • set Link icon

      public final boolean set(int uniform, int v1, int v2)
    • set Link icon

      public final boolean set(int uniform, int v1, int v2, int v3)
    • set Link icon

      public final boolean set(int uniform, int v1, int v2, int v3, int v4)
    • set Link icon

      public final boolean set(int uniform, com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor textureDesc)
    • set Link icon

      public final boolean set(int uniform, com.badlogic.gdx.graphics.GLTexture texture)