How to create an ocean for a global simulation?

Hello,

My team is transitioning from an OSG simulation mostly based in the ocean. We previously used pre-calculated FFTs for our ocean, but are starting over from the ground up with Unreal. We are wondering if anyone has good ideas on where to start for a global ocean.
Currently, our ocean follows the camera around as it moves throughout the world. My understanding with Unreal’s built in ocean is that it doesn’t really want to move with the camera. Seeing as creating water for the entire world isn’t the greatest option, we are looking for the most modern way to simulate the ocean.

Thanks in advance,
Zach

2 Likes

Hi Zach, were you able to figure something out? I’m currently going down the same path and would appreciate any advice you have.
My current approach is centered around the unreleased nanite tessellation in the ue5_main branch. I’ve tried triplanar projection of normal and displacement maps, as well as a projection from the position of the camera (kind of like what you mentioned). Both have their drawbacks. Triplanar projection is costly, and can’t easily simulate waves produced by a wind from a given direction (Would have to be a complicated equation that translates some projections while rotating others). The single projection from a camera’s point onto the world is nice, but you’re stuck having to account for camera movement, and you can’t sync waves across cameras in different locations.

Why yes.
Don’t use unreal
any other engine out there will do incredibly better job of ocean/physics simulation, particularly when you have to code all of it anyway.

Sort of wish i had seen this post a year ago, may have saved you some time.

Same advice goes for you…

Already wrong out of the gate.

Look, an ocean is best simulated with general gerstner waves.
Wind, etc, means next to nothing in deep waters where the waves have nowhere to slam.

The engine sucks at rendering (anything, but particularly) water.
Deep ocean isn’t really transparent/see-through, so you don’t even have to use a transparent material.

This saves you from having to worry about Z priority on wave peaks/valleys.

Wave height is done by running the same formula that generates the ocean and solving the X/Y @ gametime for Z.
From that, you can create bouyancy components that allow an object to respond somewhat naturally to forces and the current height of the wave.

Mesh system/rendering wise.
It really doesnt matter.

If you pan around the same mesh or use a finite world the result is the same.

You have X amount of tris all around you, at all times.

Arguably, if you set up your mesh as a sliced tris/heptagon system, then pan it around with the player, you may have a better chanche at culling whatever is not within the fustrum.
But performance really wont hit that much.

At a distance, say past 200m from camera, the ocean ends and has to turn into a regular 2tris square with a normal map - since you won’t be able to see any difference.

Controlling waves at shorelines is well beyond the simple idea of a deep ocean and introduces a bunch of things you are best off learning directly from other engines (cry, even unity, as well as some old GPU Gem articles).

If you want an outdated unreal reference, search for the community ocean project.

Ita kinda dead i think, mostly because the performance of the engine is oh so poor.
However if i recall right it had a mesh following the camera in deep water condiguration.
Also sports some advanced physics and underwater stuff.
Breaking it down will likely teach you why this is the wrong engine to use for just about any of this…

Ps: though you could try to implement Nvidia Gameworks into 4.27 to see if their water stuff works better (which it does, but its equally sub par on rendering).