Skip to content

Animations for non-pure-number properties and effects #402

@m-hall

Description

@m-hall

This is a request/proposal, and I wanted to get some advice for this before I take a look at possibly contributing a change myself.

My goal right now, is to allow gradient effects to animate their colors.

However, I think if I go down this road, it would make sense to allow any effect uniforms to have the ability to define their own animations calculations.

My proposal is to add an animate function to the ShaderEffectUniform. The definition would be something like:
animate?: (start: T, end: T, progress) => T

This would (in theory) allow any uniform to define how the values are to be interpolated. eg. allowing a number[] to be animated
Of course, the current method would be a backup for any uniform that does not define this property.

Ideally, if this works out, then I think it could be useful to allow animations on many style and shader properties that are not just single numbers, and enable custom effects to define their own interpolation as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions