Interface IntShader

All Superinterfaces:
com.badlogic.gdx.utils.Disposable
All Known Implementing Classes:
AtmosphereShader, BaseIntShader, DefaultIntShader, DepthIntShader, GroundShader, PBRDepthShader, PBRShader, RelativisticShader, TessellationShader

public interface IntShader extends com.badlogic.gdx.utils.Disposable
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    begin(com.badlogic.gdx.graphics.Camera camera, com.badlogic.gdx.graphics.g3d.utils.RenderContext context)
    Initializes the context for exclusive rendering by this shader.
    boolean
    Checks whether this shader is intended to render the IntRenderable.
    int
    Compare this shader against the other, used for sorting, light weight shaders are rendered first.
    void
    end()
    Cleanup the context so other shaders can render.
    void
    Initializes the IntShader, must be called before the IntShader can be used.
    void
    render(IntRenderable renderable)
    Renders the IntRenderable, must be called between begin(Camera, RenderContext) and end().

    Methods inherited from interface com.badlogic.gdx.utils.Disposable

    dispose
  • Method Details

    • init

      void init()
      Initializes the IntShader, must be called before the IntShader can be used. This typically compiles a ShaderProgram, fetches uniform locations and performs other preparations for usage of the IntShader.
    • compareTo

      int compareTo(IntShader other)
      Compare this shader against the other, used for sorting, light weight shaders are rendered first.
    • canRender

      boolean canRender(IntRenderable instance)
      Checks whether this shader is intended to render the IntRenderable. Use this to make sure a call to the render(IntRenderable) method will succeed. This is expected to be a fast, non-blocking method. Note that this method will only return true if it is intended to be used. Even when it returns false the IntShader might still be capable of rendering, but it's not preferred to do so.
      Parameters:
      instance - The renderable to check against this shader.
      Returns:
      true if this shader is intended to render the IntRenderable, false otherwise.
    • begin

      void begin(com.badlogic.gdx.graphics.Camera camera, com.badlogic.gdx.graphics.g3d.utils.RenderContext context)
      Initializes the context for exclusive rendering by this shader. Use the render(IntRenderable) method to render a IntRenderable. When done rendering the end() method must be called.
      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 end() method.
    • render

      void render(IntRenderable renderable)
      Renders the IntRenderable, must be called between begin(Camera, RenderContext) and end(). The IntShader instance might not be able to render every type of IntRenderables. Use the canRender(IntRenderable) method to check if the IntShader is capable of rendering a specific IntRenderable.
      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.
    • end

      void end()
      Cleanup the context so other shaders can render. Must be called when done rendering using the render(IntRenderable) method, which must be preceded by a call to begin(Camera, RenderContext). After a call to this method an call to the render(IntRenderable) method will fail until the begin(Camera, RenderContext) is called.