Skip to content

Instantly share code, notes, and snippets.

@Bailey3D
Last active October 19, 2019 20:43
Show Gist options
  • Save Bailey3D/5b67bef5b39221e4594cda84b8e3a36f to your computer and use it in GitHub Desktop.
Save Bailey3D/5b67bef5b39221e4594cda84b8e3a36f to your computer and use it in GitHub Desktop.
float4 vec = float4(0,0,0,0);
float pW = 2 / waveLength;
float wSpd = (time * phase * pW);
float wDot = (dot(wPos.xy, normalize(windVec).xy) * pW) + wSpd;
float calcSteepness = amplitude * (steepness / (amplitude * pW * 36));
vec.x = cos(wDot) * windVec.x * calcSteepness;
vec.y = cos(wDot) * windVec.y * calcSteepness;
vec.z = sin(wDot) * amplitude;
vec.w = amplitude * pW * pW * phase; //Amplitude Mask
return vec;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment