Skip to content

implicit shader uniforms #80

@Redninja106

Description

@Redninja106
  • using a static variable will automatically include it as a shader uniform

example:

class Shader : CanvasShader
{
    public float time;
    public override ColorF GetPixelColor(Vector2 position) 
    {
        return new ColorF(float.Sin(time), 0, 0, 1);
    }
}
// time would have to be set before the shader is used

would become:

class Shader : CanvasShader
{
    public override ColorF GetPixelColor(Vector2 position) 
    {
        return new ColorF(float.Sin(Time.TotalTime), 0, 0, 1);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions