Page 1 of 1

GPU Gems Wave simulation

PostPosted: Sat Sep 01, 2018 11:09 am
by T_Freeze
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.
Image
Image

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:
Image

Which i have converted to Amplify as:
Image
Image

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:
Image

Has anyone else tried to recreate this article in Amplify? Or see what I'm doing wrong. Any help is much appreciated!

Re: GPU Gems Wave simulation

PostPosted: Sat Sep 01, 2018 3:02 pm
by Ricardo Teixeira
Hello,

Thank you for getting in touch but this forum is aimed at editor support and general shader inquiries, I don't think you'll get many replies here from other users.

Unfortunately, this goes beyond of the scope of our editor; I recommend posting your question directly in the dedicated Shader section of the Unity Forum.

Thanks!