Building Ocean Simulations In Houdini
Recently, I had the joy of being part of a team that specialized in ocean and water fx. They were so bad-ass when it came to creating these simulations, that I was entranced by their skill. I thought that it might be helpful to condense some knowledge that I was allowed to learn, plus some other resources that are available for you to explore. Enjoy! Thank you David Ertsinian.
Building an Ocean Simulation
In the current version of Houdini 17, there are an amazing amount of tools you can use to build an ocean body simulation. Currently as I speak, the Preview of Houdini 18 has just been released, and inside are some lovely updates and They've added a FLIP pressure projection tool. You can view the preview here: https://www.youtube.com/watch?v=hpDxWuBN3N4&t=42s
Now let's get into our current set of ocean/water simulation tools we can use.
Small Ocean: This tool is for creating an ocean surface, not an actual ocean simulation. It's good in the sense you can simulate an ocean surface relatively fast. But if less promising if you'd like to create something that dives in and out through an ocean body. This tool does not use DOPs.
Large Ocean: This tool is similar to the small ocean tool. It doesn't use DOPs and once again is great with creating an ocean surface. This tool is also great for creating large scale oceans that span long distances.
Guided Ocean Layer: Similar to the above tools, this tool creates an ocean surface. However, it also creates a layer of particles that are controlled by point velocities. This tool is primarily a FLIP simulation, and also creates an ocean volume to create realistic ocean water levels. Grabs velocity attributes from the ocean spectrum node. Great for shallow water simulations, or for adding boats to water.
Wave Tank: A FLIP particle fluid simulation that creates a tank to simulate waves. This entire tank will be filled with particles. Great for short timed simulations. However, it doesn't have great control of the waves it contains.
Beach Tank: Another FLIP particle tank. However, this tank slowly reduces the particles velocities over a period of time on the edges of the tank. This creates the appearance of the water washing up on the shore.
Flat Tank: Another FLIP tank. However, this tank can track objects inside of it and simulate FLIP particles around the object. Great for calm water. Or huge splashes from objects included in the simulation.
Tips for Ocean Simulations
Turn of any whitewater nodes while you are working on your simulation. If they are turned on while you are working, your sim time will be incredibly slow, and your progress will be reduced.
In the Beach Tank, the tool comes preloaded with default geometry for the beach. Feel free to replace this geometry if you need to. You can then tell the simulation to reference the new geometry.
The higher you ramp up your velocity scale the more rough your waves will become, and vice versa.
The lower you reduce your particle scale, the finer in detail the waves will become. Your render, cache, and sim times will also become longer.
Don't be scared with long caching times. This is normal for water and tank simulations.
If you are using a small or large ocean tool, try changing the shading view to Smooth Shading Mode. This will help you have a better view over your waves and their appearance.
If you would like your waves to move twice as fast, try entering $T*2 into the Time parameter.
If you are working with a Guided Ocean Layer. The fluid particles are controlled by the Layer size Parameter. You can find this in the Ocean Source Node.
Decreasing the size of your particle separation will improve the appearance of your renders, and raise the amount of particles in your scene.
To create more broken up foam on your ocean. Go to your Ocean Surface Shader and lower the frequency of the streaks.
Ocean Masks and Using Volumetrics
Let's start with volumes. Volumes are important to understand while working with Ocean simulations as they will help your simulation look it's best. Volumes can either be used to help create a mask, control the appearance of the depth of the water, the appearance of the waves, and the overall shading of your Ocean body.
Rendering your volumes in Mantra can be a bit more difficult as you have to tell mantra how you would like it to handle them. By adjusting or lowering the Volume Step Rate and Volume Shadow Step Rate, you can let mantra know that you don't need the volumes to be defined, but just to calculate them in the simulation.
Keep in mind you will have to bake out your ocean geometry to render your uniform volume shader correctly.
The Ocean spectrum Node also has an option to use custom volumes to create masks over your ocean layers. Houdini can use this mask to change the amplitude of your ocean simulation, and to create more detailed movement on the surface of your ocean. You can also you the volume mask to create very localized noise in your simulation.
Here we go! The Houdini Spectrum Node is one of, if not the most important node you can use in your Ocean Simulations. This Node controls the volumes inside your ocean body, and the overall information for creating the waves. Let's dive inside, and try and figure it out.
To start, this node primarily relies on three attributes to operate. The Phase, Frequency, and The Amplitude. Any node placed after the ocean spectrum node will require these attributes to correctly evaluate the information for your ocean body. A node such as the Ocean Evaluate Node will refuse to operate at all without these values.
Phase: Controls the Offset of the waves.
Amplitude: Controls the maximum displacement and distance of your waves.
Frequency: Controls the angle of your waves. As well as the time it takes for one wave to complete of cycle.
It is also recommended while working with the Ocean Spectrum Node to increase the Resolution Exponent. This is because in the default settings of this parameter, artifacts will be visible in your render. Increasing this parameter to something like 11 or 12 will remove these.
Other Tips About Ocean Spectrum
If you are aiming for slow waves consider lowering your Timescale parameter to a lower value.
You can use the Filter Above Resolution parameter to clear away any wave that have higher or lower frequencies than you would like.
Play with the Grid Center if you'd like to adjust where you waves are coming from, or if you would like control over a particular wave in your simulation.
Under the wind tab, you can use the Directional Bias to fix any waves that refuse to align with the direction you would like them to move in. They will be dampened out the more this parameter is increased.
Beware of the Chop parameter. If this is set too high the waves will become inverted on themselves and start clipping.
Using the Normalize Parameter under Wave Amplitude will allow you to change some more features of your waves. This function maintains the height of your waves. And at the same time makes sure only the speed and the scale of the Amplitude are affecting the waves. Turning this off will make the waves affected by other parameters as well.
Always use your visualization tools! Visualizing the spectrum can help in so many ways regarding how you troubleshoot your simulation.
Lighting an Ocean Body
For lighting an ocean, always keep in mind the size of your ocean body, the material settings for the surface and volume of the ocean, lighting samples, the direction of your light sources, and the reflections of any other objects in the scene. The appearance of your sim will be affected accordingly.
Sometimes while lighting an ocean , you might have to change your lighting to something a bit different from your regular scenes. To start, always add an environment light. Your ocean needs reflections in it's environment to help create it's ocean colors. Try and match your HDRI as best as you can to your chosen scene. Both shadow, color, time of day, and environment wise. So far so good.
Here lighting can be a bit more fun. I have a friend who uses a secondary environment light in his scene so he can create a light striking the ocean volume, and the other for the ocean surface. He uses the same HDRI map for both. This seems to work for murkier water. Another way to approach the lighting is to create your default environment, directional, and ambient light and work from there. I'd recommend this route if you don't have any lighting reference. If you have a lighting reference, try and move your lights accordingly to match the shadows and direction of the light source.
If you need proxy geometry in your scene, go right ahead and add them. You can channel them out separately in your render passes later. But for example, let's say you have a beach scene. There are docks,boats, and buildings intersecting with the water. You'll still need geometry for those objects in your scene to create the reflections. This will further help your scene look cohesive.
Cg Wiki Flip Fluids/DOPs : http://www.tokeru.com/cgwiki/index.php?title=HoudiniDops#Flip
Oceans Sidefx: https://www.sidefx.com/docs/houdini/fluid/oceans.html
Generalized Non-Reflecting Boundaries for Fluid Re-Simulation: http://delivery.acm.org/10.1145/2930000/2925963/a96-bojsen-hansen.pdfip=220.127.116.11&id=2925963&acc=OA&key=4D4702B0C3E38B35%2E4D4702B0C3E38B35%2E4D4702B0C3E38B35%2E845B08FEB461FA0C&__acm__=1572218224_ac4fdc4f0faf4b7ccb57d24fc135f359
SideFx Ocean Spectrum Node: https://www.sidefx.com/docs/houdini/nodes/sop/oceanspectrum.html
OdForce Displace Ocean Spectrum on Deformed Mesh: https://forums.odforce.net/topic/41193-displace-ocean-spectrum-on-deformed-mesh/
Displacement Quality (Ocean Spectrum) OdForce: https://forums.odforce.net/topic/32693-displacement-quality-ocean-spectrum/
Ocean Evaluate Mask OdForce: https://forums.odforce.net/topic/25182-ocean-evaluate-mask/
Flyro learning to create an ocean part 3: https://med3017m-1819-14565893level3digital.coursework.lincoln.ac.uk/2018/10/22/learning-to-create-an-ocean-part-3/
Wiki Ocean Spectrum: https://wiki.etc.cmu.edu/index.php/Ocean_Spectrum
FFT Ocean Algorithm : http://wanochoi.com/lecture/Houdini16_Ocean.pdf
Your Bag of Tricks: http://yourbagoftricks.blogspot.com/2016/02/ocean-tank-types-differences.html