Procedural Beach Placement/'Concavity vs Convexity' masking

Hi!
I’m fairly new to World Machine; I first tried it years ago and liked it, but never dug that deep. I’ve picked it back up for a game development project with a pretty large environment, and the results I’m getting, in general, are way better now having spent some time learning.

One thing I’m having a bit of an issue with is beaches. The coastal erosion macro is nice, but by default gets applied everywhere on the shoreline which, save for specific types of islands, feels pretty unnatural. I know I can mask the beaches manually, but I was wondering whether it might be possible to place them procedurally.

Basically, in a lot of coastal terrain, as a very general rule of thumb, the concave areas end up as beaches, and the convex areas end up as cliffs. Of course such a rule alone is not perfect, but it’s a pretty solid starting point.

Example: https://www.google.com/maps/@57.6231753,-7.3427993,13840m/data=!3m1!1e3

It seems to me beaches are far from the only areas where you might want to mask stuff based on the general ‘shape’ of a piece of terrain above a certain height, but I can’t figure out any way to do something like that.

Wondering whether anyone has any suggestions, or whether I’ll just have to stick to manual masking.

Cheers!

1 Like

I think one thing to keep in mind is that even those cliff shorelines do have a beach area, it just tends to be under water (though sometimes at a low tide you can see it exposed). Just on first instinct, my method of attack for something like that would be to use the coastal erosion device as-is, add a touch of inland height influence to get nice sandy beaches in the low lying areas, and then adjust the water level after the fact (if you’re trying to keep your water contained within the network, try adding another coastal erosion immediately after, but with all the settings set to their minimum value, and the water level set to a height that gives you the cliffs you’d like without “drowning” your sandy beaches.

I have no idea if that would work right off the bat, that’s just my first instinct on what I would try. I can see about possibly nailing down a “working” workflow when I get home from work (if nobody else has chimed in by then)

2 Likes

That’s definitely a fair point, maybe doing that then some combination/masking of erosion masks to flatten/further erode the newly-above-water ‘beach’ areas would work well. Will have a fiddle.

Whilst reading this I thought to myself, fun problem to tackle. Here’s my take on it!

It all has to do with using the Abmient Occlusion device to “reveal” the concave parts of your terrain. See the image below.

You can clearly discriminate the concave parts using this method. I suggest doing some pre- and post-processing on the masking of course, and I’ll link the .tmd file with my processing setup down below.

Then, using this masking, we can create the beaches accordingly (again, with a bit of preprocessing of the terrain to help the Coast Erosion device).

On the left you have the naive approach, just using the Coast Erosion device. On the right, we do a bit of preprocessing of the terrain and drive the beach creation using the “concave mask”.

The nodes:

As you can see, I’ve downscaled the Ambient Occlusion device, this is because we don’t need a high resolution AO map, and this really improves rendering time!

Good luck!

beaches-based-on-convex-concave-terrain.tmd (130.7 KB)

3 Likes

Wow, I’d never have thought to use AO, but the logic there is sound. Thanks, I’ll definitely give this a try!

3 Likes

Just to report back, I’m really liking a two-step coastal erosion process, essentially with the first for low tide, the second for high tide. Using AO for both stages, the first stage’s beach ‘masking’ more subtle, the second stage more picky. Even though we’re kind of abusing AO, this technique gives a surprising amount of fine-grained control, will share some results once I’m happy w/ my map overall. :wink:

3 Likes

I really liked the block-out of this island and could not resist doing something with it. It totally ran away with me, prompting me to create a bunch of new macros to finish it out to my liking.

branch beaches-based-on-convex-concave-terrain.tmd (981.8 KB)

1 Like

I posted a bit too soon. I still had to address the inland waters in the texturing. Here’s an update:

branch beaches-based-on-convex-concave-terrain.tmd (1.1 MB)

Any feedback is welcome, and the macros can be used or shared as needed. I have not tried porting these new ones back to 4031 so they might only work in 4032. Is there any way so save them with backwards compatibility (some automatic conversion opposed to the “update all devices” you can do to bring old graphs up to date?

1 Like

It is really cool to see your take on this! Appreciate the creative vibes :slight_smile:

Maybe you could make the ocean floor a bit more realistic? It now appears to be just the same terrain, but then underwater, or am I mistaken?

EDIT:
Okay at a quick glance it appeared to be unaltered, but on a second look I see there is some sand placing going on there, all be it subtle! Doing underwater stuff seems like quite a challenge to me so not here to be too critical :Þ

No worries. I’m no expert so I was going by feel and I’ve learned the hard way that good results come from having a very light touch. I used to always over-emphasize.

Let me see if I can post the Sketchfab…

I think that worked. Well, I’m glad it turned out as well as it did. Thanks for your comments!

1 Like

I wanted to see how this scaled up, so I zoomed in on the cove extents and rendered at 4K. Here’s some screengrabs:




(cont)

Part 2:




1 Like