Gerstner waves are named after František Josef Gerstner, who discovered them.

Fill in your details below or click an icon to log in: You are commenting using your WordPress.com account. There is a relation between the wavelength and the wave amplitude. Because we're working at at larger scale now, you might have to increase the shadow distance before they appear. Note that all vector properties are 4D, so just ignore the Z and W components. We can use `a=e^(kb)/k`, where `b` has to do with surface pressure. We'll leave the fragment surface function unchanged. We can turn our sine wave into a circle by using `P=[[acosf],[asinf]]`, but that would collapse the entire plane into a single circle. For example, a wavelength of 2 produces a standing sawtooth wave. In reality, waves don't have an arbitrary phase speed. The simplest approach is to just use another mesh. Now how much `x` contributes to the wave function is modulated by the X component of `D`. This tutorial is made with Unity 2017.4.4f1. The fundamental observation is that while waves move across a water surface, the water itself doesn't move along with it. For example, reducing the wavelength to 20 while keeping the amplitude at 10 produces weird results. And `f^'=k`, so we end up with `T=[[1],[kacosf]]`. Color = lerp( _Ambient , _Scatter, _ScatterFactor) * LightColor + Spec; The Spec term was a phong specular reflection multiplied with the the skycolor.

After multiplyling those together and using them to interpolate between the Ambient and Scatter colors, I got a pretty good result.

Finally, normalization doesn't happen per individual wave. We'll use Unity's default vertex data structure, appdata_full. As the crest of a wave approaches, the point moves toward it. For a single wave i, Qi of 0 gives the usual rolling sine wave, and Qi = 1/ (wi Ai) gives a sharp crest.

( Log Out /  This gives us a grid of 10×10 quads to work with.

The quads of the plane are of unit size, so the entire plane covers a 10×10 area centered on its local origin. When the surface water moves down, where does the water below it go? The loop duration is equal to the period of the large wave, which is `lambda/c=2^6/(2^3q)=2^3/q~~6.41` seconds. Instead, create a default plane via GameObject / 3D Object / Plane and have it use the Waves material. …

Gerstner Wave shader + analytical splashes - Duration: 0:48. Big wind waves are realistically modeled by the Stokes wave function, but it's rather complex. Effective Water Simulation from Physical Models, http://http.developer.nvidia.com/GPUGems/gpugems_ch01.html, http://gamedev.stackexchange.com/questions/69827/gerstner-wave-function-simplified, http://forum.unity3d.com/threads/possible-to-pass-surface-shader-tessellation-output-to-vert-frag.333314/. Create a new surface shader named Waves. We can say that we have `P_y=asinf`, where `f=k(x-ct)`. Work fast with our official CLI.

Let's add a property to our shader so we can use `P_y = a sin x` instead, where `a` is the amplitude. We have to use the chain rule, `(P_y)^'=f^'acosf`.

But for our wave we have to use `T=P^'=[[x^'],[asin(k(x-ct))^']]`. The more waves we add, the more complex our shader becomes.

Also, the stronger the gravity the faster the movement. For a flat surface `T=[[x^'],[0]]=[[1],[0]]`, which corresponds to the original plane's tangent. Learn more. Because we changed the surface function, its derivate has also changed.

Add a direction property to our shader and incorporate it into our function. In the case of `T_x` and `T_y` this simply means that we multiply with `D_x` one more time. In reality it is rare to find only a single uniform wave traveling across a water surface. The raw sky color seem really over bearing until I interpolated it on a fernsel function and then multiplied that by the light attenuation. This is the wavelength and let's make it configurable too. That instructs Unity to create a separate shadow caster pass for our shader that also uses our vertex displacement function.