|
|
The Wave Displacement project has to do with the creation of creating a realistic water by using a displacement shader. The difficulties of the project will come from trying to keep the waves from being patternistic (if that's really a word). I am not trying to create a flag but rather an orangic free moving animation.
|
 |
The First step has to do with creating a sine wave. This look something like:
float s_shift = s +offset
s_shift refers to the waves moving along the s value and offset will be a user controled number for where the wave is at any given time.
This paired with
hump = (sin(s_shift * 2 * PI * number_of_waves)
Hump represents our bump.. bump would have been used if it wasn't already taken.. and we'll call number_of_waves "num_waves" for short.
Now let's add some randomness to the wave.
|
 |
I added:
s_shift = s_shift + noise(pp * 5) * 0.05
I also lowerd the Km value from 0.1 to 0.03 to lower the waves
|
 |
So things are beginning to roll on this shader. My next step was to add a second wave. I created new arguements bum_waves (the number of waves of the second wave) and boffset (the offset for the second wave). I then created a new s_shift I called this one a_shift.
a_shift = ((s + boffset) + (s + boffset) + (t + boffset)) / 3
This is to make the wave come in at a different angle. now:
hump = hump + (sin(a_shift * 2 * PI * bum_waves)
Now that's starting to look good... In case you lost here's my full script. Also you're going to want to lower the Km agian since you're adding the waves together. I put it back down to 0.01
Cool now let's animate it by setting up a .rib then a .key. To get the waves moving I will be changing the offset and boffset. I'm also going to animate things like num_waves slightly so it looks like the waves disapate..
|