GDShader doesn’t pause
In Godot 4.0, GDShaders don’t pause when the tree is paused as the time parameter continues to increase while the game is paused.
Unfortunately, it doesn’t appear like the Godot maintainers will fix this for 4.0, because they believe the canonical solution for this should be to add a new global uniform to the project that takes whether or not the tree is paused into account for use in a shader.
A potential workaround looks like this:
In order to work, a global shader parameter with the name SCALED_TIME
needs to exist in the project settings and this code needs be added to an autoloaded singleton.