Edit:
I changed the wave function to something more simple for now, I basically removed the power to 2.
So, the derivative of:
float wave1 = 30.0f * sin(fs * dir_vertex + t);
should now be:
float tan1y = cos(fs * dir.x * wave_vertex.x) float bitan1y = cos(fs * dir.y * wave_vertex.z);(is t in the derivative equation? I think not, as it's constant)
However this too doesn't give me a correct result.