Page 1 of 1

Ocean Shader Normal Reconstruction

PostPosted: Sun Jun 03, 2018 8:17 am
by ToxicBOI
Hi ! :D
I'm trying to implement the ocean shader from the GPU gems on a tesselated plane(https://developer.nvidia.com/gpugems/GP ... _ch01.html), here's my graph :
Image

The Sin Shader Function simply outputs the displacement based on the parameters and the world position, I use one for the displacement in the X direction and one for the Y direction (vertical in unity), here it is :
Image
Image

My question is : How should I go about reconstructing the normals of this shader ? I don't understand how the example works and the equation in the GPU Gems paper seems to produce strange artefacts, probably because the paper and unity uses different x y z coordinate system.

I hope someone here can help me, I've been struggling with this for a long time ^^

Re: Ocean Shader Normal Reconstruction

PostPosted: Sun Jun 03, 2018 5:06 pm
by ToxicBOI
Nevermind, I just found the solution!
In case anyone has the same problem, just pipe the displacement into this :
Image

Re: Ocean Shader Normal Reconstruction

PostPosted: Mon Jun 04, 2018 10:56 am
by Amplify_Borba
Hello, thank you for reporting that you've found a solution and for sharing it with the community, and apologies for not being able to get back to you in time to provide assistance!

Please don't hesitate to let us know if you have any further questions or come across any issues.