The issue I have is simple: a mesh is animated via a vertex shader (a swimming fish).
It is lighten by a spotlight that projects its shadow on a plane.
If spotlight, plane and mesh are still (no modification of transform), the shadow is not updated, and it ends up with an inaccurate shadow on the ground (see screenshot).
If I move any of the spatials, the shadows is updated correctly, but as soon as everything is still, the issue reappear.
I've temporarly fixed this with a script on the spotlight that randomises slightly its position.
export (bool) var _vibrate : bool = true
var initialised : bool = false
var fixed_translation : Vector3 = Vector3()
if not _vibrate:
if not initialised:
fixed_translation = translation
initialised = true
translation = fixed_translation + Vector3(rand_range(-0.001,0.001),0,0)
It triggers the shadows rendering (see below)
I think it's a dirty solution, but I couldn't find a way in the documentation to enforce shadow re-computation in a standard scene.
Does anybody have a solution for this?
All the best, godot rocks!