I’m currently trying to build my own ocean shader (gerstner-based, entirely in blueprints so far, because every time I think about brushing up on my C++ skillls I get severe anxiety) and I’m at a point where I’d like to try and implement the illusion of an infinite ocean. The ocean does not actually have to be infinite, it just has to provide me with a large enough area to sail around in and look like it’s reaching the horizon.
Now, obviously I could just scale up the plane with my ocean shader and call it a day, but that’d be pretty inefficient. My current idea was therefore to have a “pizza” mesh that moves around with the player and is divided into several rings with lower subdivisions the further out you go. The central part would have the actual water shader applied, the middle ring a simpler version of the shader with some displacement and the outer ring a very simple color shader that extends to the horizon. The idea here being that I’d only need to waste computational power on the small part of the ocean where the player can actually appreciate the detail and notice any changes (e.g weather).
My main question now is, does my concept make sense? Is there a better way? If so, what is it?
tl;dr: Want to make infinite looking ocean to sail around in. Have an idea of how to do it but don’t know if there isn’t a smarter way to do it. What do?
Download and check how the community ocean project does it.
It’s basically a procedural mesh with the material that gets rendered in chunks around you.
simple to do since its completely flat and the shader moves the vertices.
Not sure if it extends to the horizon. But I can tell you that past 20 or 30m the wave Z become irrelevant. Having a flat plane with a normal map moving looks about the same.
so you just pack the gerstner result into a normal and use that across the whole thing.
Then just use a distance based solution to remove tessellation and the displacement gradually. Parameterize it and test distances that work for your project / resolutions. 4k needs maybe 40m.
Also. the pizza mesh may not be a bad idea tessellation wise because of how subdivision works. BUT. When you are at the center you always render the whole mesh. Making it a bad idea.
half a pizza, or a pizza based on field of view angle would be more efficient…
getting consistent distribution of vertex across slices isn’t going to happen though since it’s radial. Just keep that in mind.