Share

Prevent Crest splines from shifting with ocean waves

  • 25/April/2023
  • 1

I’m a big fan of Crest for water systems in my games. I use the Crest HDRP version but there are versions for each pipeline. It works so well because it can simulate all kinds of ocean weather – especially in conjunction with two other great assets – Enviro 3 and Dynamic Water Physics 2.

Crest and Waves

Naturally, the most prominent feature of any ocean system is always going to be waves. Crest does waves excellently BUT Crest does not only offer oceans.

Crest allows you to create lakes and rivers using splines. By default, these splines are going to share all of the materials and simulation details of the main ocean body. So what do we need to change so we can have a calm lake even when the sea is turbulent and avoid rivers jumping out of their trenches?

Tip 1: Shallow Attenuation

You should be using attenuation to prevent ocean waves under land masses or can use some other method to flatten things

Dale (Crest)

Most of us want waves to lap the beach and not end suddenly, so likely have the ocean renderer’s ‘Attenuation in Shallows’ set to a value less than 1 (in the Sim Settings [for] Animated Waves) but very close. A value like 0.1 would mean the waves reach much further under the land masses, which we don’t want. You can also stop those waves going so far inland by increasing the ‘Shallows Max Depth’ – essentially making the max-power waves happen only in deeper water.

Tip 2: Make sure the lake/river has it’s own FFT Component

The lake or river spline should have an FFT component (which can be added automatically by pressing ‘Add Waves’) and that it has a Register Height Input component (to interact with the cached depth information)

You can add a calmer wave spectrum and reduce things like wind on the FFT component.

Tip 3: Make sure the depth cache is up to date

This one you won’t find in the manual directly – the easist thing to get wrong is the Crest Ocean Depth Cache. This cache maps the ocean and land locations to a texture so it can handle the shallow areas and coast.

  • Make sure the Transform Y position stays at zero (the warning on the component can be confusing) and that the cache is in the centre of the piece of terrain you want to map – for example, on a 1000×1000 terrain you’ll want your Transform X and Z to be 500.
  • Check your layers – the depth cache has a layers selector. If you have separate layers for rocks and terrains for example, you’ll want to select both
  • Camera Max Terrain Height should be tall enough to cover the surface of your lake
  • Sanity check yourself – after you populate the cache, check the texture on the material attached to the Depth Cache, it should show both red and black if it’s in a mixed land & sea area and configured correctly
1
0
Would love your thoughts, please comment.x
()
x