I'm trying to write a simple shader that moves all verts with a sin wave.
v.vertex.y += sin(_Time.y * _Speed + v.vertex.x * _Amount * v.vertex.z) * _Distance;
The problem is that after moving them, the normals are wrong, thus there are no real time shadows. I've searched a lot and found that I need to recalculate the normals using fake neighbours. None of the implementations were for Unity Shaderlab, so I can't just copy and paste them, and my knowledge of shader code is pretty basic so I can't translate what I found to what I need.
Can anyone help me with what and how to recalculate normals after moving a vertex?