johanhelsing / bevy_smud

Sdf 2d shape renderer for Bevy
Other
141 stars 10 forks source link

Add time uniform #2

Closed johanhelsing closed 2 years ago

johanhelsing commented 2 years ago

I think using time to animate things in shaders is such a basic thing to want that it should probably just always be available. It allows implementing really cool stuff with very little effort.

Also, the performance overhead of needlessly adding the time uniform when not used is probably very low (but should double check this)

@omphalosprime did this in their fork: https://github.com/omphalosprime/bevy_smud/commit/72b2043082d0fb51f487675b0c65d37d5d46dcaa

Also relevant: https://github.com/bevyengine/bevy/blob/main/examples/shader/animate_shader.rs