You are on page 1of 13

Procedural Building Generator 2

Version 1.1
For Blender 3.6+
Created by Isak Waltin

PBG 2 is a Geometry Nodes setup for Blender that turns any mesh into a render-ready
building. It allows you to drag and drop a building preset onto an object and edit it in
real-time.

The base version comes with 5 building styles included.

Online version of this documentation: PBG 2 Documentation

Documentation
Documentation....................................................................................................................... 1
Getting started....................................................................................................................2
Setup PBG 2 in a project....................................................................................................2
Modeling tips...................................................................................................................... 3
Custom setup..................................................................................................................... 4
Node groups.......................................................................................................................5
Settings.............................................................................................................................. 6
Simulations and deforming meshes................................................................................... 7
Interior mapping (fake interiors)......................................................................................... 8
Create your own style.........................................................................................................9
Convert to mesh............................................................................................................... 11
Convert to instances.........................................................................................................12
Explanations.....................................................................................................................12
FAQ and support.................................................................................................................. 12
License..................................................................................................................................13
Version log............................................................................................................................ 13
Getting started
When you download this product, you get a ZIP file. This is not an addon, so it can’t be
installed the way an addon would be.

Here’s how to set it up once you’ve downloaded it:

1. Extract the zip file and place the folder somewhere convenient
2. Open Blender. Go to Edit>Preferences>File Paths>Asset Libraries
3. Click “+” and navigate to the folder “PBG_2”. Select it.
4. Set “Import method” to Link
5. Done!

The download contains a blend file with the generator, and subfolders with asset packs.
If you purchase more asset packs later, extract them and place them in the PBG_2
folder!

Setup PBG 2 in a project


Once you’ve completed the initial setup, all you need to do to add the Building Generator to
an object is to open the Asset Browser and drag out a PBG node group.

There are 3 ways to setup the generator:

● Super quick setup: Drag a Preset onto an object. This will instantly generate a
render-ready building from that mesh. Presets have a few settings you can tweak
right from the modifier window, like color and seed.

● Quick setup: Drag a generator (Simple Building or Two-Part Building) onto an


object. You also need to pick a style; they can be found in the Asset Browser as well.
With a generator, all the settings are exposed in the modifier window.

● Custom setup: See Custom setup.

After setting up the generator for an object, you can start modeling your mesh as usual. The
generator will adapt in real-time.
Modeling tips
Quads usually give the best looking results. Tris work too, but might look less realistic.
N-gons are not supported.

Scaling the object in object mode will also scale all the assets. If you instead scale in edit
mode (or apply the scale in object mode with CTRL+A), the building will be re-generated as
a larger building (read: more floors, as opposed to just bigger wall instances).

Staying within the realms of realistic building shapes will likely give the best results, but the
generator is built to handle most meshes nonetheless.

Try to keep faces flat. Consider turning a bent quad into two tris by connecting two of its
vertices using J.

Left: A distorted quad (visualized with Mesh Analysis)


Solution 1: Triangulate distorted faces (CTRL-T or select 2 opposing vertices and press J)
Solution 2: Flatten distorted faces (for example by scaling on Normal Z axis)

Useful tools:
S, X/Y/Z Scale on one axis (press SHIFT+X/Y/Z to scale on the other two axes)

G, X/Y/Z Move on one axis

E Extrude selection

CTRL+R Add loop cuts to the mesh

Y Split the mesh. Useful if you want to separate the roof and scale it to
create an overhang.

J Create a path between two vertices.

ALT+Left click Select an edge loop

CTRL+A (in Object mode) Apply scale, location or rotation


Custom setup
PBG 2 also comes with a couple of modular node groups that can be used in combination to
get a building with more in-depth control than Simple Building or Two-Part Building. These
node groups can be used either as separate modifiers or in one Geometry Nodes modifier.

The simplest setup (with the same result as the Simple Building node group) is to add a
Create Points followed by an Instance Assets. To create a multi-segment building, use a
Create Points followed by one or more Add Segment, followed in turn by two or more
Instance assets (or similar).

Examples:

This is the same as the Simple Building node group

This setup enables mixing assets from different styles.


Select which ones in Instance Mixed Assets.

Here’s how to add more than 2 segments to a building.


Node groups
These are the node groups that come with PBG 2. All of them can be dragged and dropped
on an object in your scene, but some only work in combination with others.

Simple Building
Dragging the Simple Building node group onto an object will turn it into a
basic, procedurally generated building. You will need to select a style in the
modifier settings.

Two-part Building
The Two-Part Building node group will turn a mesh into a procedural building
with two segments. Really useful if you want shops on the bottom floor, a
stone basement or only want to generate doors on the bottom floor.
You will need to select styles for both the bottom and the top segment (they
can be the same).

Fake Interior
Add a Fake interior to a building. The rooms appear to have depth but are
actually just one polygon each.

Create Points
This node group generates points to instance building assets on. It is meant
to be used in combination with either one of the Instance node groups below,
and instead of the all-in-one building generators described above.

Add Segment
This will split the building, vertically. You will need a Create Points node group
above this one, and two Instance Assets node groups (or any of the node
groups that instance assets) after this one.

Instance Assets
This node group instances building assets on points generated by the Create
Points node group. You will need to select a style in the modifier settings. All 3
Instancing node groups are interchangeable.

Instance Mixed Assets


Like Instance Assets, instances building assets on points generated by the
Create Points node group. However, with this node group you can select 2-3
styles and mix them. For example, you can use it to have walls from the
Wooden style and a tile roof from the Half-Timbered style.
Instance Custom Collections
Instances building assets on points generated by the Create Points node
group. You will need to select a separate collection for every asset type
specified.

Preserve State
This is meant to be used if you need to deform the mesh. See Simulations
and deforming meshes for more info.
What this node group actually does is save the positions, normals and other
properties of the mesh so that it can be retrieved after deforming it.

Convert to mesh
See Convert to mesh

Settings
Since the generators and presets are built from the same modular pieces, they share most
of the settings that are accessed directly from the modifier.

Align walls horizontally: The generator will try to rotate wall assets as parallel to the
ground as possible.
Flat roof as floor: Replace roof assets parallel to the ground with floor assets.
Use small roof tiles: Scatter “Small roof tile” asset (if it exists) across the roof.
Only use square walls: Disable Wide and Half wall assets.

Beam settings control the placement of corner beams on the walls and the roof.
Pillars: Place pillars where the building overhangs either itself, or the object chosen as
Ground collision.

Greeble settings control the small details scattered across the roof and walls.
Align: Align to surface
Rotate: Randomize rotation (on local Z axis)
Advanced distribution: Enable if mesh will be animated/simulated. See Simulations and
deforming meshes

Place doors: Place the door asset (if it exists) randomly.


Single wall/roof type: Use only one type of asset for walls/roof.

Checking Ceiling or Floor will add extra geometry to fill in the ceiling/floor, with the selected
materials.
Color settings are a bit special. Most of the styles that come with PBG 2 are set up to use
them. The alpha value controls how much of the selected color is mixed in, and the color
controls the color.
See Material colors if you want to add this for your own styles.

Simulations and deforming meshes


PBG 2 comes with some experimental components to help with handling deforming meshes.
As an example, you might want to apply the building generator to a character that is
deforming with an armature.

To ensure that the deforming building gets generated consistently across frames:

● Add the Preserve State node group BEFORE any deforming modifiers, then add
building generator node groups as usual AFTER the deforming modifiers.
● If you are using greebles, check “Advanced Instancing” under Greeble settings.
This avoids flickering when the mesh is deforming. (Note: Only works in combination
with Preserve State)

Known limitations:

● Extreme mesh deformations will result in inconsistencies.


● Edge beams might flicker during playback. I haven’t found the cause of this and it
isn’t consistent. To avoid this, either turn off all beams in the Beam settings, or
re-render the faulty frames.
● Pillars do not work well with deforming meshes. Consider disabling them.
● Greeble rotation is wonky, to say the least.

An example of a setup where a cloth sim is applied to the building:


Interior mapping (fake interiors)
In PBG2 v1.1, interior mapping support was added. To use this, drag the new node group
“Fake Interior” onto an object which already has a building generator node group on it.

Interior mapping is simply a shader that looks like it has depth, and will therefore add a
minimal amount of polygons to your scene, making it cheap. It is also prerendered, which
further adds to its performance.

Settings for interior mapping

You can control how many of the “rooms” will have their lights on, and what texture set
(interior type) to use from the ones that come with PBG2 v1.1.
Create your own style
There’s a guide for creating your own building style included in the blend file:

It shows all asset types you can have as well as their dimensions and orientations. If the
dimensions are unspecified (e.g. all axes where it says X*Y*Z or X in X*1.0*1.0), any
dimensions will work.

Steps to create your own style

● First, create your assets. They should have the dimensions displayed in the guide
above. You can create as many variations as you want for each asset type, for more
variation. Make sure that the object origin is in the correct place, and that the object
Scale and Rotation is applied (CTRL+A). You can use the Template Style as
reference (which you can find in the pbg_2.blend file).

● Move each asset with the move tool (G) into the corresponding square. This means
that, when viewed from above, a square wall asset should be within the square in the
bottom left (and its origin too).

● Create a new collection for your style. Select all your new assets and move them into
this new collection using M.
● To use this style on an object, drag the Simple Building node group to it. Select your
new collection in the “Style” setting of the Simple Building modifier.

Assets
Some asset types (marked with *) are required for the basic building shape to appear, the
rest are optional. The more assets of each type you create, the more variation the generated
buildings will have.

Make sure the assets have the correct rotation and dimensions. Use the assets in the
Template Building Style as a guide, and look at the dimensions specified in the Building style
guide (the grid pictured above). It is always good practice to apply rotation and scale with
CMD/CTRL+A.

Asset types
Square & triangle wall *: Used to build the main wall shapes.
Wide & half wall: Complementary wall pieces, these cover a wider range of possible wall
shapes and are used to minimize unnaturally stretched assets. Can be disabled.
Square & triangle roof *: These build up every possible roof shape.
Square & triangle floor *: Floor. Can also be used instead of flat roofs if “Flat roof as floor”
is checked.
Door: The door assets are separated in order to allow for turning them off, for example on
upper floors.
Thin beam: Asset used (if enabled) between faces on a wall.
Thick beam: Thick beams are instanced (if enabled) on the corners of the walls, as well as
roof edges and (if present) wall edges. The generator will try to orient these in the same
direction relative to the corner, allowing for details such as quoins.
Pillars: Pillars will be placed (if enabled) where the source mesh overhangs itself, or where it
overhangs a specified collision mesh.
Roof ridge cap: Instanced on the ridge of the roof and, flipped 180 degrees, in the valleys of
the roof.
Roof small tile: Can be enabled, is scattered across the roof randomly.
Roof details: Instanced across the roof randomly.
Wall details: Instanced along the walls randomly.

(* necessary to build the basic building shape)

Categories/Collections
There are two methods for categorizing your assets for use with PBG 2.

The recommended method is to put all the assets in ONE single collection. Make
sure that the object origin is within the square of the corresponding category of the guide.

If you use this method, you can use your building style with ease by just selecting the
collection as the style, when using the Simple Building, Two-Part Building, Instance Assets
and Instance Mixed Assets node groups.
An alternative method is to put all the assets into separate collections, one for each of
the specified asset types. When using this method, you must use the Instance Custom
Collections node group (in combination with Create Points). You also need to select all the
collections manually every time you want to use the building style.

Material colors
When creating materials for your own assets, you can use the attributes Paint color,
Secondary color and Door color to control the color. This is how the pre-packaged styles
work. The alpha of the color is used as the mix factor, i.e. how much of the specified color to
mix in.

Convert to mesh
If you want to edit the mesh of the generated building, you will need to convert the building to
a mesh.

1. Drag the Convert To Mesh node group onto the building.


2. (In object mode with the building selected) Go to Object>Convert>Mesh and check
Merge UVs.
3. (Optionally) Bake the materials. See tutorials on Blender texture baking for this.

The materials in the pre-packaged styles were made for Blender and might not look the
same if exported. Baking is one solution.
Convert to instances
If you want access to the individual instances that a building is made of, you can convert the
building to instances:

In object mode, go to Object>Apply>Make Instances Real.

Exporting files with instances works well with FBX files (but materials do not export
correctly). Exporting to USD seems to be broken with these types of instances, and will only
import as unique geometry. I have not personally tested importing these exported files in any
game engine, but it might be possible.

Explanations
PBG 2 or the Building Generator: This product, a collection of node groups, presets and
styles.
Node group: A geometry node group. Can be dragged from the asset browser onto an
object.
Style: A Style (or Building Style) refers to a collection of assets that can be selected to be
used in a procedural building.
Preset: A preset in this case is a node group that is already set up with a style and some
settings applied. You can drag it directly from the asset browser onto an object.
Asset Browser/Library: Blender has an asset browser that allows you to access your Asset
Library from any blender project. PBG 2 is set up to use the Asset Library out of the box.
Greebles: Small details scattered across a surface.

FAQ and support


Frequently Asked Questions will be added here.

If you still need help, join my support Discord server.


License
For buildings generated using PBG 2: Personal and commercial use is allowed, credit is
appreciated.

You may not redistribute any of the geometry node groups themselves, for free or
commercially.

The asset packs contain assets (materials, textures and models) from Polyhaven.com,
ambientCG.com, Wikimedia Commons, and https://www.si.edu/openaccess. They are
licensed under Creative Commons — CC0 1.0 Universal.

Version log
1.1:
- Added Interior Mapping: New node group and 3 texture sets of pre-rendered rooms.
- Changed instancing type to support converting buildings to Linked Instances.
- Added Style Guide and Template Style to the asset browser.
- Fixed Half-timbered materials transparency mode.

1.0.1, 1.0.2 & 1.0.3:


- Replaced all textures that were not strictly compliant with Creative Commons
licenses.
- Changed Thick Beams to always point up.
- Fixed Stone building style UV maps.

You might also like