Class BaseShader

    • Constructor Detail

      • BaseShader

        public BaseShader()
    • Method Detail

      • register

        public int register​(java.lang.String alias,
                            BaseShader.Validator validator,
                            BaseShader.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

        public int register​(java.lang.String alias,
                            BaseShader.Setter setter)
      • register

        public int register​(java.lang.String alias)
      • getUniformID

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

        public java.lang.String getUniformAlias​(int id)
        Returns:
        The input at the specified id.
      • init

        public void init​(ShaderProgram program,
                         Renderable renderable)
        Initialize this shader, causing all registered uniforms/attributes to be fetched.
      • begin

        public void begin​(Camera camera,
                          RenderContext context)
        Description copied from interface: Shader
        Initializes the context for exclusive rendering by this shader. Use the Shader.render(Renderable) method to render a Renderable. When done rendering the Shader.end() method must be called.
        Specified by:
        begin in interface Shader
        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 Shader.end() method.
      • dispose

        public void dispose()
        Description copied from interface: Disposable
        Releases all resources of this object.
        Specified by:
        dispose in interface Disposable
      • has

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

        public final int loc​(int inputID)
      • set

        public final boolean set​(int uniform,
                                 Matrix4 value)
      • set

        public final boolean set​(int uniform,
                                 Matrix3 value)
      • set

        public final boolean set​(int uniform,
                                 Vector3 value)
      • set

        public final boolean set​(int uniform,
                                 Vector2 value)
      • set

        public final boolean set​(int uniform,
                                 Color value)
      • set

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

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

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

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

        public final boolean set​(int uniform,
                                 int value)
      • set

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

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

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

        public final boolean set​(int uniform,
                                 GLTexture texture)