Hello,
I've been trying to follow this GPU Gems article on gerstner water simulation:
https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch01.html
So far everything seems fine and I managed to get the Gerstner waves to work nicely according to their function.
Later on the article goes on about adding extra detail by calculating the surface orientation at any point on the plane.
They say this is possible as the information needed to calculate this can be obtained from the same function that is used to calculate the vertex positions. The surface orientation can be calculated by the crossproduct of the binormal and the tangent.
They give the following functions for calculating the normal and tangent:
Which i have converted to Amplify as:
I then take the crosspoduct of these two variables and plug this into the normal port of my shader. This gives me rather weird results:
Has anyone else tried to recreate this article in Amplify? Or see what I'm doing wrong. Any help is much appreciated!