Procedural Abandoned House with Geometry Nodes

So altering the scale a bit I managed to get a selection that’s slightly more wall-like. Turning down the randomness gets it straighter.


Is this right?

1 Like

Hello @Chryron and welcome to BA !
I think you’re closer than you might think ! I don’t recall exactly how I did it, but I think you need to subdivide the grid a bit more, and try to get an thinner selection.
And from there you can massage the result to get something cleaner. Like merging by distance , convert to curve, resample…

Yes that’s it !Well Done !
By playing with the setup you should be able to add a bit more randomness.
It’s not a 100% bullet proof technique but it can do cool things once you find the sweet spot for grid subdivision and thin selection !

Keep up the good work !

Ah I don’t think I’ve actually figured it out after all. Turning the randomness down to 0 makes the selection the same on all floors and turning randomness up makes the walls thicker and not straight. So unsure what to do.

Related question, is there a way to have a seed input for the randomness of the voronoi texture?

Merge by distance seems to help but the walls are diagonal instead of parallel to the grid. Also if there are too many floors the merge by distance might merge neighboring floors together.

1 Like

Hum, then try to add more subdivisions to the grid , and lower the greater than value to get nearly an edge. Then work from here : merge by distance, and try to clean the selection from here.

How you plugged the nodes should give you some random offset for the voronoi, (plugin object index into the W) you can also alter the vector.
Probably if you plug a position node into the vector socket nothing will change. But then you can add the object index to the position, and even multiply the index , that should translate each voronoi pattern so you get different results.

Good luck !

Playing around with values I get something that looks like walls but I cannot for the life of me figure out what to change in order to make the selection align with the edges of the grid. Sorry to keep bothering you with this :sob: Right now the selection is just based on voronoi cells so it doesn’t care where the edges of the grid are.

1 Like

try a merge by distance after the separate geometry, with a value a bit higher than one cell of the grid.
That should make it a bit better. Something looks a bit weird indeed but it’s hard to see exactly what it is.

You can share a .blend with a simplified setup similar to yours and I’ll try to look at it tomorrow !

Its better but the walls are still not straight.

Here’s my blend file.

1 Like

Hello Chryron !

I’ve made a few tweaks to your setup :


Interior2.blend (1.6 MB)

Really it wasn’t much , mainly it’s the resample curve set to 2 that does most of the job.

I removed the subdivide for the grid , it should be benchmarked but probably it’s faster that way.

I’ve also modified the way the texture is applied in order to get each floor a bit different even when random is at 0. And I also tweaked a bit some values for selection and merge by distance.

The next step would be to remove too little segments so it doesn’t create tiny walls that won’t look natural.

Sometime it gives wierd results also so maybe there is room for improvements :


I don’t recall having something like that, but at least what you did looks quite close to what I remember doing at that time. Maybe it’s just a matter of increasing the merge, or do a tighter selection…

It’s really a quick and dirty way to get some walls, but I’m pretty sure it’s possible to do that in a very different manner if needed !

Good luck !

2 Likes

Thanks again! I ended up turning the randomness down to 0 in order to get the walls straight. I used a curve profile for the wall and raycasting to keep it within the base mesh. I then deleted walls that weren’t parallel to the x or y axes based on the normals of the mesh, as well as deleting walls under the slanted roofs of the house using raycasting again.

I’m now working on placing doors and other assets on the floors. I used a curves to points node to pick random points on the wall to place doors, but I’m struggling to obtain the normals of the walls to rotate the doors correctly. I’m sure I’ll figure that part out though.

Do you have any advice on how to place assets in rooms without the assets intersecting with each other, the interior walls, or walls of the base mesh? Also as you can see from the gif I still have some walls which are relatively short and I can’t seem to figure out a way to get the length of curves in order to delete the walls that are too short, any advice on this would also be very helpful. Thanks again for all the help you’ve provided thus far!

Well done ! It’s going good !

I don’t really know a easy way to place assets, this is quite tricky for sure.
There is no easy way to pack arbitrary assets, maybe the blender 3.3 pack UV island can help to hack something.
That something I started to look into but with the limited toolset GN provides it’s very challenging.

It also really goes down the how correct you want the result to be. you can probably emit some points on the floor, get the biggest asset you have ( say a bed that is 2m long) you do a poisson disc with 2m distance between each point.
Then you use proximity on the wall to remove points than are less that 1m of distance of the walls.
And you instance your assets, which i theory shouldn’t intersect with the walls or each other.
After a bit of struggle to get proper orientations, you may end up with rooms full of beds, or with only a chair in the middle if you’re lucky :smiley:

Another way would be to get a wall, calculate the distance to the next wall, see if you can put a bed, in front of the bed you put something relevant like a TV monitor, you can manage intersection by using always the same unit, if the biggest object is 2m, then try to fit everything in these 2m, like a desk and a chair… That way you get a more logical result, but then it may lack a bit of randomness and every rooms will look basically the same.

It depends also if you want to build assets procedurally, or use existing ones.

Frankly it’s complex, and probably with the best procedural software available ( houdini) some part of that thing will be done using script alongside most powerful nodes inside the software.

That shouldn’t prevent you to try , it’s probably possible to do something in blender, it will be just more painful hacking than “the way to go method”, but from my experience it’s always possible to hack something given some time and energy. If you start by doing proper brainstorming , testing , you may end up pulling it out and that would be awesome !

And to get the size of the walls, I’d convert them to curve first, resample them with a count of 2, then convert to mesh, use the edge vertices nodes , and plug each vertices position into a math node set to distance. At least it will work, maybe there is a way without converting to mesh.

Good luck, it’s getting cool and I’m looking forward how you’ll manage to populate these rooms.
If you find a crazy trick to do that and are willing to share a bit about the theory behind it , that would be very kind of you to poke me then so I can have a look at it !

1 Like

This is actually amazing!! Great work. Can’t wait to see what you create next!

1 Like

Thanks a lot !

1 Like

Congratulations, this work has been nominated for the ‘Best of Blender Artists 2022’ award in the #geometry-nodes category! You can vote for it here.

3 Likes

wow !
This is greatly inspiring !

Thanks for this wonderfull piece of tech&art :smiley:

Happy blending !

1 Like

Amazing! Really good looking houses, very realistic.

1 Like

Thanks a lot @pitibonom and @Micro-Chimp !

2 Likes

Oh, I didn’t know that the most liked project is yours, Sozap!

Nicely done!

2 Likes

Hello
Can you tell me where I can see this tutorial?

1 Like

Hello @Aliasghar708_Art and welcome to blenderartists !

There isn’t a tutorial, but you can read through this thread to learn a bit how it’s done.
If you have questions on a specific topic I’ll try my best to answer them !

Have fun !

5 Likes