The quads of the plane are of unit size, so the entire plane covers a 10×10 area centered on its local origin. If nothing happens, download Xcode and try again. Instead, create a default plane via GameObject / 3D Object / Plane and have it use the Waves material. For this tutorial, we simply set no restrictions at all. In reality it is rare to find only a single uniform wave traveling across a water surface.
Simulacra 2 wallpaper code#
Then move the wave code to a new GerstnerWave function. We have to use the chain rule, `(P_y)^'=f^'acosf`. Let's add a property to our shader so we can use `P_y = a sin x` instead, where `a` is the amplitude.
And there are two version of implements, Gerstner wave and Sine wave. Ignoring the Z dimension for now, the position of each vertex can be defined as `P = ,]`, where `P` is its final position, `x` is the original X coordinate, and `y` is the original Y coordinate, both in object space. The sudo code looks something like this: float waveThickness = saturate(mul(_World2Object, worldSpace).y * _ScatterStrength) The simplest way to make a wave is to use a sine wave based on `x`, so `y = sin x`. Final Composition Work fast with our official CLI.
Simulacra 2 wallpaper series#
This is the third tutorial in a series about creating the appearance of flowing materials.Ĭreate a free website or blog at. The solution is to include addshadow in the surface pragma directive. We can say that we have `P_y=asinf`, where `f=k(x-ct)`. Use this trick to define a property for our first wave, wave A. So we end up with `sin((2pix)/lambda)`, where `lambda` (lambda) is the wavelength. But `z` now also plays a role, in the same way, which leads to `f=k(D_x x+D_z z-ct)`. In case of zero pressure, we end up with `a=1/k`, which produces 0° crests, the sharpest possible before looping. Note that this relationship means that longer waves have a higher phase speed.
That's the same formula as before, just with the summation added. It is most convenient to use the phase speed `c`, which defines how fast the entire wave moves in units per second. The shader is simply a summation of waves, each wave having the following components: This controls the pinch on the wave. In other words, we're using the dot product of `D` and the original X and Z coordinates. Now how much `x` contributes to the wave function is modulated by the X component of `D`. On large bodies of water-like an ocean of big lake-the wind can create big waves that can persist for a long time.