this post was submitted on 16 Jul 2025
17 points (100.0% liked)

Procedural Generation

161 readers
7 users here now

A community to discuss and share anything procedural generation related, for example game worlds and assets, or simulations whether scientific or ludic.

From Wikipedia:

Procedural generation is a method of creating data algorithmically as opposed to manually, typically through a combination of human-generated assets and algorithms coupled with computer-generated randomness and processing power.

founded 2 years ago
MODERATORS
 

A procgen weekend project in Blender and geometry nodes. The idea was to start from a simple painted map -as simple and childlike- as possible, and let the computer do the rest.

Some images of the process :

Extract map contours

Separate seafloor from land

Look at the distance to shore

Filter it some

A voronoi for the rocks

Masked so they only appear near the shore

Roughly the same approach for the seafloor

A couple materials, water surface, Nishita sky

Cheers !

top 9 comments
sorted by: hot top controversial new old
[–] troyunrau@lemmy.ca 3 points 2 weeks ago (1 children)

Content! Yay!

Looks cool -- how do you like blender for the task?

[–] Hadriscus@jlai.lu 3 points 2 weeks ago (1 children)

Cheers ! hey ! can you hear the echo in here?

how do you like blender for the task?

I can't say I have used anything else much. It's quite low level, functional. It has concepts like fields which I think are fantastic. If you're a programmer type you may enjoy using it. But there's no dedicated object type / data structure (heightfields) or feature set for terrain -so performance isn't optimal and you have to make your own tools. You can even build your own erosion solver, I made a very crude one pretty quickly just winging it. (I see you're a geologist!). That being said if I wanted to go realistic I would turn to something dedicated like Gaea or Houdini's terrain tools which are really something else.

[–] troyunrau@lemmy.ca 2 points 2 weeks ago (2 children)

I've largely rolled my own tools from scratch in python when playing with terrain generation, including writing my own perlin generators and everything. But that's mostly because I want to learn about the methods more than actually produce anything useful. Sample.

[–] Hadriscus@jlai.lu 2 points 2 weeks ago (1 children)

I've looked at this map closer, the coastline looks great. Just how vanilla is this perlin noise ? I would assume you mix several of them. I very much wonder what this looks like in 3D

[–] troyunrau@lemmy.ca 2 points 2 weeks ago (1 children)

I start with perlin with several scales, mixed together. But then I do a lot of extra stuff.

For example, a filter of my own creation I call "swiggle" helps create curved linear features. Sample of what it does to a checkerboard.

I like to find things like steep gradients and erode them to help form mountain ranges that have passes in them and such. So I'll do something like a Voronoi map, where the density of cells is related to the map gradient. Then calculate features per cell. That way great plains stay relatively flat.

I'm currently hung up in doing erosion and deposition properly. Not like a fake single pass version, but an iterative version that moves things over time. That has led me into some scientific computing rabbit holes where geoscientists do real simulations. But python cannot handle that well.

[–] Hadriscus@jlai.lu 2 points 2 weeks ago (1 children)

Ah nice swiggle. It creates vortices in input coordinates or something to that effect ?

If you're finding gradients does that mean you compute surface derivatives or do you "just" look at neighbouring points ? I can't figure that out in geonodes yet, supposedly that's something a shader is better suited for (and more performant). But I don't know the first thing about OSL and stuff.

Wrt erosion, in Blender there's a framework in place for making solvers (simulation zone). But you still have to write the actual solver... and I have to say I totally overlooked deposition last time I worked on it... and "worked" is a big word 😉

[–] troyunrau@lemmy.ca 2 points 2 weeks ago

Yeah, swiggle is pretty much exactly that. The coordinates, amplitudes, and radius are randomized (based on the map seed, so it is reproducible). It makes a good distortion on top of things like mountain range positions. You don't see the swirls in practice.

Yeah, I mathematically compute a gradient vector. Which is actually one of the very easy things to do in python. I then bias Voronoi cell centre point density based on the amplitude of the local gradient.

The same gradient calculations would be used in a real erosion/deposition model. Where the gradient is high, erode. Move those particles down gradient. Deposit particles where gradient is less steep. Repeat a thousand times. Marvel at emergent phenomenon like river valleys and deltas. It's the "repeat a thousand times" that python really struggles with. It's fine to run it once and wait. But I don't want it to be days of modeling per map :)

[–] Hadriscus@jlai.lu 2 points 2 weeks ago (1 children)

Nice ! colors are mapped to elevation ?

But that's mostly because I want to learn about the methods more than actually produce anything useful.

Yea I can relate, for me it's about half-half. Ultimately, I do want to output cute images. I've never written a noise generator though I would be curious to learn at some point.

How's the performance with Python ? have you tried generating meshes/SDFs from these height fields ?

[–] troyunrau@lemmy.ca 2 points 2 weeks ago

Yeah, colours to elevation.

Since I am mostly using Python as a math engine, and python isn't a very good math engine (even with numpy), performance isn't great. The map above is about 15 minutes to generate. I could spend hours answering the why 😂

But basically I'm just storing elevations in a 2D array. Then applying various filters to it to make things more geologically reasonable. Start with noise, add mountains in places that make sense, fjords, floodplains! Etc. I think I have about 18 processing phases now. But each step requires a lot of math -- math that GPUs are very good at.

I also haven't tried to optimize things too much.