[Unity] Tesselated Ocean Shader Normal Reconstruction
![[Deleted User]](https://polycount.com/themes/polycount/design/default-avatar.gif)
[Deleted User]
polycounter lvl 5
in Unity
Hi ! 

I'm trying to make an ocean shader based on this GPU Gems article (https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch01.html ) and this YouTube tutorial(https://www.youtube.com/watch?v=_y7Z0MbGOMw), with Unity's Amplify Shader editor. Here's my graph :
And the Gerstner Wave Shader Function is a bit messy :
But it's basically this function :
Here's my question : In the video and in the paper, they uses this function to recalculate the vertex normals :
But I can't figure out how to reproduce the Unreal Graph for this function inside of Amplify Shader Editor, it gives me really strange artifacts.
I assume that it's because both the paper and Unreal uses different x y z coordinates systems, but I can't figure out what to change :c
How should I go about recalculate these normals ? I hope someone here can help me, I've been struggling with this a lot !
PS: I'm french, please excuse my english ^^
Replies
-
Nevermind, I just found the solution ! In case anyone have the same problem, just pipe your displacement into this :
-
Hey did you plug in the output of Local vertex offset into DDX and DDY? Also, where do you plug in the output of the nodes in the last picture?