Hello and welcome to the Maya Learning Channel.
In this series of videos, I’ll be showing you how to create a beautiful,
physically accurate ocean
using the Bifrost Ocean Simulation System, or BOSS for short.
Before we begin, I’d like to give a quick shout out to Diego Trazzi,
on whose work these tutorials are based.
To start, I’m just going to make sure that BOSS is loaded up here in the Plug-in Manager.
There it is.
Now, BOSS works by taking a polygon and deforming it.
In this case, I’m going to use a plane since it’s both lightweight
and the closest representation of an actual patch of water.
That said, you could use another shape depending on the effect you're going for.
I’ll just make it bigger and add some subdivisions.
Now I’ll switch to the Bifrost Fluids workspace…
Which gives me access to the Boss Editor here.
When creating a BOSS ocean, there are two main columns I need to manage.
Wave solvers, as you might imagine, deal with generating the waves in our ocean…
…while influences deal mostly with colliders, like boats and rocks.
We’ll get into that later, but for now I want to focus on generating good looking waves,
which is as easy as clicking the Spectral Waves button here.
Spectral Waves are the types of waves generated
when wind blows over large bodies of water.
At first that doesn’t seem to do much,
but if I play the animation you can see the waves take effect on frame 2.
Of course, if I turn on Wireframe on Shaded here,
you can see that the resolution of our ocean isn’t very high, so its not very detailed.
But looking in the Outliner, you can see that BOSS has actually left my original plane intact.
So I can easily increase its subdivisions.
This is pretty handy for adjusting detail vs performance on the fly.
Two other settings that can help with that are the wave solver’s Resolution and Patch Size.
Resolution is separate from the resolution of the plane geometry.
It actually represents the resolution of the chunk of ocean we're displaying.
Think of the plane as a window into a whole other water world.
The Patch Size represents the size of that world,
while the Resolution represents the fidelity of it.
So if I move the plane around, I can see other parts of that world.
Now you might think to yourself,
“wouldn’t I always want to match the size of my plane to the size of my patch?"
After all, why would I ever want to simulate water outside of what I can see?”
The answer is because the Patch Size also determines the maximum wave size.
If you make the Patch Size too small,
then you’re limiting the potential of the tallest possible wave as well.
Of course, larger patches also consume more processing power,
especially because you’ll need higher resolutions to display them smoothly.
So like anything it’s a balancing act.
Next, I'll take a moment to briefly talk about scene scale.
By default, Maya’s working units are in cm – in other words, one grid space is equal to one cm.
However, Bifrost’s solver is tuned for meters.
This is important, because it means that things like gravity, wind speed, and so on
are only accurate in a scene where everything is built to a 1 unit = 1 meter scale.
In other words, this patch of ocean here is 20m x 20m, NOT 20cm x 20cm.
For more on scale in Bifrost, check out our reference video or consult the documentation.
Now that we understand resolution and scale, how do I adjust the look of my ocean?
Well you might see this Wave Height attribute and think, “I’ll just increase this,”
but this is an artificial multiplier.
In real life, waves are a result of wind and ocean depth.
Without these, the ocean would look as flat as our plane.
So to get more realistic results, we’re going to play with Wind Speed and Fetch Distance.
Wind Speed is self-explanatory,
but Fetch refers to the length of water over which that wind was blown.
In general, faster winds over longer distances equal bigger waves.
If you’re wondering exactly what wind speed to use,
refer to something called the Beaufort Scale,
which outlines the wind speed necessary for everything from a calm day to a hurricane.
Additionally, Ocean Depth can also have an impact on wave size too,
since shallow waters tend to shorten wave lengths.
Finally, you may have noticed by now that our waves are very round.
Real waves tend to crest more sharply.
This is because our simulation is only calculating the vertical movement of the waves.
So let's add some Horizontal Displacement as well.
To dial in the look, I’ll increase the Wave Size until we start to see noticeable artifacts.
Next I'll try 4... and maybe even 5.
Right here. See the artifacts? That means I went a little too high.
Still a bit more.
That's better.
That’s it for our primary waves. For even more accuracy, I could add a second wave solver.
This will act as the smaller secondary waves, though it will impact performance.
You can mitigate this performance hit by caching the simulation.
Once the simulation runs through, you’ll see these icons turn green,
signifying that the animation is running off a cache.
Similarly, if I scroll down in the Attribute Editor,
you’ll see that Use Cache is enabled as well as the location of the cache.
Just remember that any further alterations will require that you disable the cache first.
To render this out, all I need to do is apply a standard Arnold surface shader to it…
…and then apply the “Deep Water” preset.
Then I’ll just add a Skydome light…
…and assign it an HDR image.
You can find these images on the web, or create them yourself.
Either way, they’ll provide the accurate reflections and refractions
that'll really help sell the look.
Now I'm ready for a test render.
That's pretty good! If I had one critique though,
it's that we need a bit of white foam added.
If I go back to my primary wave solver, I can turn on Foam generation here.
Unlike all the other settings though, this actually doesn’t affect my realtime simulation.
Instead, it generates a map of 2D images that I can then overlay on top of my shader.
You can find these images in the Foam Cache down here.
This only gets generated when I cache the wave solver though,
so I’ll need to disable the old cache first and then generate a new one.
If you did this right, you'll now find foam files in your cache folder.
To see them in my render, I just need to assign them to the Arnold shader’s Emission Weight.
Make sure to check this Use Image Sequence button
so that it uses all the images we generated.
Okay, there’s definitely foam now. Probably a little too much, to be honest.
This is like what you’d get in a cove or something.
To get a more open ocean look, I’ll return to the Spectral Wave node
and reduce the Cusp Min. of the foam generation.
As a side note, BOSS foam isn't physically accurate.
Rather, it uses injected cusp values to define the look.
However, it's fast, and in this case it'll get close enough to the real thing.
To get physically accurate foam, I would've had to use Bifrost particles,
which I'll show in a later tutorial.
Now I'll switch off the cache again.
This time, rather than regenerate the entire cache,
I'll test just a single frame by turning on this Export Cache checkbox.
This allows me to cache any frame simply by advancing the Time Slider to it.
That's much more like I wanted.
In fact, I like it enough to cache the entire animation again.
Now I’ll just set up a sequence render.
So multiple frames, and 2 to 120.
Then I'll go to the Rendering Menu Set.
And select Render > Render Sequence.
And after a minute or two, this is what I get.
Not bad for only a few minutes of work!
So that about does it for our basic ocean.
I encourage you to play around with the attributes to dial in a look you like.
In our next lesson, I’ll show you how to render this single tile into a vast, infinite ocean.