Procedural Beach Placement/'Concavity vs Convexity' masking

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.


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.


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)


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)


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


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: