Created
October 9, 2017 09:39
-
-
Save yorung/ea0a57b4bd2bdcf6ab73706c0bce499b to your computer and use it in GitHub Desktop.
Calculate gerstner wave normals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float3 ofsByGerstnerWave = CalcGerstnerWaveOffset(vertexPosition); | |
float3 dx = float3(0.01, 0, 0) + CalcGerstnerWaveOffset(vertexPosition + float3(0.01, 0, 0)); | |
float3 dz = float3(0, 0, 0.01) + CalcGerstnerWaveOffset(vertexPosition + float3(0, 0, 0.01)); | |
float3 N = normalize(cross(dz - ofsByGerstnerWave, dx - ofsByGerstnerWave)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment