Roof Generator Experiments 01 - Blender Geometry Nodes

General / 15 March 2023

This will be a brief breakdown of my experiments with making a rough roof generator to be used at the grey-boxing stage of a game project I'm working on with my partner Maito Jobbe-Duval. She's an art director with an art and theatre background and has designed lots of spaces for the theatre company Punchdrunk. Our collaboration is, at this stage, intended as way for the two of us to expand our portfolio, she in Level design and Art Direction, me in Programming and Technical Art, and for the two of us to hopefully get a demo together to publish and have something out there in the world. More about the specifics of the game in future posts but for now, rooves, roofs, whatever...

The asset is designed to be used at the blockout/greyboxing stages in the Unreal Engine, a key scene in the game plays out on the rooftops and our game is top-down view so I thought it would be a good thing to have at this stage to do some rough play tests and to help generate some concept art.

Google streetview image reference.

Generating 'Hip-rooves' seems to be a bit better documented than generating the gable roof that is more prevalent in the architecture in our game. This resource "Procedural Venice" was great to read through. To some extent the gable roof is much simpler but I found a few challenges thrown up when trying to use irregular shaped building blocks and bevelled corners.

I started off using Blender and Geometry Nodes as I've really enjoyed using it recently on the project for Shezad Dawood. I had intended to use the Altermesh plugin for unreal after having a very brief experiment with it - and it does seem great - however I've switched to Houdini, mainly because it supports Unreal's brushes system and not just Static Meshes (like Altermesh), and we're keen to do the block out in Unreal as far as possible at this stage.

First I'm extracting the top-most plane of the cube
Then Finding the longest parallel-ish edges in order to disregard any bevelled edges, I say paralell-ish because I want this to work on none regular rectangular buildings as the game is set in a small village of which the folky unplanned architecture is a feature.

Then I'm adding a new plane, bisected along the apex and using the original "Top Plane" geo extruded and a boolean op to create this which will become the roof.

Then I'm extruding the apex of the roof based on the new geometry's proximity to the apex edge.
During my research for this I found this really cool node group from Blender Bash to inset faces which I then use to add some overhang to the roof.

In it's current iteration it has some limitations, none-parallel edges generate irregular none-flat roof planes and I'd also like to be able to offset the apex along it's opposite axis

It's a little tricky to negotiate the feature list of this, what is necessary and what is just a nice to have?

This is as far as I got with geometry nodes before switching to Houdini which I think makes sense to have in a separate post...