Interface Shader

    • Method Detail

      • init

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

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

        boolean canRender​(Renderable instance)
        Checks whether this shader is intended to render the Renderable. Use this to make sure a call to the render(Renderable) 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 Shader 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 Renderable, false otherwise.
      • begin

        void begin​(Camera camera,
                   RenderContext context)
        Initializes the context for exclusive rendering by this shader. Use the render(Renderable) method to render a Renderable. 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.