local variables for shaders

Godot Version

4.5

Question

For my game, I created a shader that draws a circle to create a “wave” attack that grows, but the variable I use for the circle’s radius is shared among all attacks. Is there a way to create local variables for different instances of the same shader?

Use different materials with the same shader. If this is inside an instantiated scene, enable material’s resource_local_to_scene flag.

You can use instance uniform parameters in spatial shaders.