Ocean Shader Normal Reconstruction
Posted: Sun Jun 03, 2018 8:17 am
Hi !
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 :
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 :
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 ^^
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 :
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 :
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 ^^