Procedural Tile-Based Building Generation

Hello!
Been playing with a geonodes setup that can take a set of tiles (faces, corners, roof, etc.) and put them together in a building.
Currently have an index and id based system that only works for cubic shapes, inspired by Kammerbild’s videos.




Tileset

There are three main parts: figure out where the tiles should go (Main node setup), figure out what can go there and pick something (Part chooser), and figure out what orientation it should point (Rotator). At the moment the whole setup needs to be adjusted depending on the number of tiles and their indexes in the collection that holds them, but the results are pretty good already: here are some renders I did (with some added scenery)


Next steps:

  1. Make the part choosing collection dependent (not index dependent). This should make adding new parts/taking out old parts significantly easier.
  2. Make the setup work for any mesh with square faces of the right dimensions. This means we can have overhangs and cutouts.

Suggestions/feedback/comments much appreciated!

1 Like

1 - encode face-edge normalized at each edge
2 - separate outside edge using ‘face neighbors less than 2’ on edge domain
3 - store ‘p2’ per edge (edge vertices node)
4 - edges to points (set position to p1)
5 - points to vertices
6 - extrude vertex (0 length)
7- set position (‘top’ - > stored p2)

8 - extrude edge → (vector(0,0,1))

now top of the two extrudes can be used to form UV that ‘flow’ around the building

from here we can replace each face with real 3d geometry using ‘tesselate’ nodegroup by higgas

Really nice, great for that large open-world generation without using too many resources or requiring too much work (to use, not to set up!). Also nice approach for the camera based culling.
In the meantime been working on something with finer control for individual buildings that allows overhangs, holes and the like, will share it soon.

Ok, here goes version 2!

First off, I completely rewrote the node setup to allow custom input meshes (including non-cuboids), to avoid needing to realize the instances, and to use collections instead of indexes as user input (even if it still uses indexes under the hood). Note that the input mesh still needs to be composed only of 4x4 square faces to work.


Here are the node groups:


Note that I added an optional realize instances option. While this does impact performance (although less than you might expect) it allows deforming the output mesh (i.e. with the simple deform modifier) to create pseudo-organic buildings: