Skip to content

implicit shader uniforms #80

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);
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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