Buildings and Volumes¶
A Building turns a closed footprint into a building. Its volumes say how many floors go where, and the Volume Wall assets they use say what each side of the building looks like.
Creating a building¶
- In the Buildings module, set Draw Creates to Building.
- Click Edit Buildings.
- Hold Shift and click to place the first corner, then click to place the others. Drag while placing a corner to pull out its handles and curve the walls next to it.
- Click the first corner again, or right-click, to close the footprint.
The building generates right away, using the Building Rules set under New Building Defaults.
While drawing
- A footprint needs at least three corners. Finishing with fewer removes it.
- Esc throws away the footprint you're drawing, and also stops Edit Buildings.
- Shift-click starts a new building only when no building is selected. With a building or block selected, it adds the new outline to that object's spline instead, and a building only uses the first outline of its spline. Click an empty spot first to clear the selection.
To edit a footprint later, click Edit Buildings and move its knots like any spline. Press Esc to stop editing.
You can also add the Building component to an object yourself (Add Component > World Toolkit > Buildings > Building). It picks up a Spline Container on the same object. Then give it volumes or a Rules Override.
Building settings¶
The top of the inspector sums up the last generation and lists any problems (see Checking the result). Changing a setting regenerates the building. To build it again by hand, select it and click Regenerate in the Buildings panel.
- Spline Container
- The footprint: the first spline of this container.
- Explicit Footprint
- A list of corner points, in the building's local space. With three or more points it replaces the spline, and its walls are always straight. Buildings generated by a block use it for their lot.
- Rules Override
- When set, the building takes its volumes from these Building Rules instead of its own, which are hidden. Floors and subfloors come from the rules unless they're locked here, and editing the rules regenerates the building. New creates a rules asset and assigns it. Expand the field to edit the rules right here.
- Volumes
- The building's own volumes, used when there's no Rules Override. See Volumes.
- Floors and Subfloors
- How many floors above ground, and how many below (basements, foundations). They normally come from the rules. Enable Lock Floors or Lock Subfloors to keep this building's own value.
- Auto Bake After Generation
- After each generation, combines the generated pieces into a single mesh on a Baked Mesh child object, with a Mesh Collider and a Building Baked Mesh Output component. It's lighter to render. The separate pieces are put away in the pool. On by default.
- Baked Mesh Source Asset
- A mesh asset that each bake writes into, so the baked mesh is stored in your project instead of in the scene.
- Randomize Seed and Seed
- Rules can be random: which wall goes where, which pieces a slot uses, how many floors. The seed keeps the result stable. Change it to get a different variation from the same rules. With Randomize Seed on, the building rolls a new seed every time rules are applied to it, and the Seed field is locked.
To turn a building's current setup into a reusable asset, right-click the Building component and choose Create Building Rules From Current Setup.... See Building Rules.
Floor handle¶
While the Buildings module is active, every building shows a small handle above its top:
- Drag it up or down to add or remove floors.
- Double-click it to turn Lock Floors on or off. The handle is green while the floors are unlocked and red while they're locked.
On a building with a Rules Override, dragging locks its floors, so the count you dragged to sticks.
Volumes¶
Each volume is a block of floors with its own walls and roof.
- Key
- A name other volumes use to stack on top of this one.
- Foundation
- Foundation volumes grow downward from their ground zero and use the building's subfloor count.
- Ground Zero Volume and Ground Zero Floor
- Where this volume starts. With no ground zero volume, it starts at the footprint base. Pick another volume's key to stack on it, and Ground Zero Floor to choose at which floor: 0 is its base, 1 the top of its first floor. Negative values count from the top: -1 is the top of the last floor.
- The field warns when no volume has the chosen key (the volume then starts at the footprint base), or when volumes stack on each other in a loop (the volume isn't generated until the loop is broken).
- Floor Count
- Floors in this volume. 0 uses the building's floor count, or its subfloor count for foundations.
- Start Floor and Height Offset
- Floors skipped from ground zero before the first floor (measured with this volume's first floor height, and downward for foundations), and an extra height in meters.
- Terrain Level
- On sloped ground, where the base sits between the lowest (0) and highest (1) corner of the footprint. Ignored when a ground zero volume is set.
- Footprint Spline
- A footprint of its own, from a spline in the scene. Leave it empty to use the Explicit Footprint below, or else the building's footprint.
- Explicit Footprint
- Corner points in the building's local space, used when Footprint Spline is empty. Building Rules keep volume footprints this way, since an asset can't point at a spline in the scene.
- Walls
- The walls placed along the footprint sides. See Walls.
- Roof
- The roof on the last floor. Foundations ignore it. New creates a roof asset, and expanding the field lets you edit the roof right here.
Ground Zero Floor, Start Floor and Height Offset are ranges: turn on Random to enter a minimum and a maximum, and each building picks a value in between, using its seed.
Overlapping volumes
Volumes aren't cut against each other. Where two volumes overlap at the same height, both build their walls inside the other and their mouldings z-fight. Make a projection part of one footprint, or stack the volumes instead. The building inspector warns when this happens.
Walls¶
A Volume Wall asset (Assets > Create > World Toolkit > Buildings > Volume Wall) describes what goes along a footprint side. It's a list of rows stacked floor by floor, plus an optional Corner.
Editing a wall regenerates every building in the open scenes that uses it. With many buildings, the Scene view shows Regenerating buildings and a count while it works through them: selected buildings first, then the ones closest to the camera.
Starting from a kit of prefabs¶
If you have wall, window and door prefabs but no wall asset yet, World Toolkit can build a first Volume Wall from them:
- Select the prefabs in the Project window.
- Choose Assets > Create > World Toolkit > Buildings > Volume Wall From Selected Prefabs. It's also in the Project window's right-click menu, under Create.
The prefabs are sorted by what their names contain:
| Name contains | Used for |
|---|---|
door |
A ground row, one floor high, with the doors placed once. |
window or win_ |
An upper row for all the other floors, with the windows distributed along each side. |
corner |
The wall's corner, if the prefab has a vertical cut at its middle. Without one, it counts as a plain wall piece. |
| anything else | Plain wall pieces. The first one (or the first window or door, without any) fills each row: it's stretched on both sides of the doors and windows, so any side length is covered. |
Without a corner prefab, the wall gets a flat procedural corner in the material of its first wall piece. Prefabs without a mesh are skipped.
The new wall is saved next to the first prefab, named after what the prefab names have in common, and selected. Open it to tune the rows, then give it to a volume's sides (see Assigning walls to sides).
The wall inspector¶
- At the top, the inspector lists what the generator would skip: rows without slots or items, slots without pieces, pieces without a mesh, chances of 0, corners that can't be built. Click an issue to jump to its field.
- Floor Rows shows which row each floor gets for a number of Floors, top floor first.
- The Wall Preview at the bottom of the inspector builds a single face of the wall, with no corners. Its toolbar has Iso (orthographic camera), Wire (wireframe), W (the face width in meters), Floors, Seed with Reroll, Grid (four seeds side by side) and Reset. Drag in the preview to orbit, scroll to zoom.
Assigning walls to sides¶
A volume's Walls list decides which wall each footprint side gets. Side 0 runs from knot 0 to knot 1, and so on.
- Chance
- The chance this wall takes its turn. On a failed roll, the next wall is tried.
- Max Uses
- How many sides this wall can cover. 0 is unlimited.
- Explicit Knot Start
- Starts this wall at a specific footprint knot, and it covers the sides from there until the next explicit wall. Use -1 to take turns with the other -1 walls instead.
Sides that no wall can take get the first wall.
Rows¶
A row is one band of the wall, one floor high. Rows are listed from the bottom up (foundations go from the top down):
- Name
- A label for the row, shown in issues and in the Scene view overlay.
- Max Floors
- How many floors this row covers. Rows set to 0 share evenly the floors the other rows leave. For example, a ground row (1), an upper row (0) and a cornice row (1) give a five-floor volume one ground floor, three upper floors and the cornice on top. If every row has a Max Floors, the floors above them get no wall: set one row to 0 to fill the rest.
- Corner
- A corner used only on this row's floors. See Corners.
Each floor is as tall as the tallest row any wall puts on it, so corners stay aligned. A shorter row leaves a gap above it, and the building inspector says so.
Mouldings count as floors: a procedural plinth or cornice row takes a floor of its own. Count those rows when you set floor counts. A box with a plinth, one storey and a cornice needs three floors.
Prefab rows¶
A prefab row is made of Slots, laid out one after another from the start of the side (after the corner, if there is one). Each slot holds Modular Pieces: prefabs such as a window, a door or a plain panel, each with a Chance of being considered, rolled per wall and floor.
- Placement
- Single places the slot's pieces once. Distribute repeats them along the side as many times as they fit, leaving room for the Single slots after it.
- Stretching
- Stretch To Fit scales the slot's pieces along the side so the row fills it exactly. Without a stretching slot, the length left over stays open at the end of the side.
- Chance
- The chance for the slot to be used, rolled per wall and floor. Below 1, the whole slot can be left out.
- Max Pieces Count
- The most pieces this slot places on each floor, across all walls. 0 is unlimited.
Modelling pieces
- Model each piece with its front facing +Z: that side faces out of the building.
- A piece takes as much of the side as its bounds are wide along X, and sits on the row's base. A prefab row is as tall as its tallest piece.
- A Single slot that doesn't fit what's left of the side is left out, and the building inspector says where. Shorter pieces or a Stretch To Fit filler slot avoid it.
The piece field warns when a prefab has no mesh (it still reserves a 1 m box but renders nothing) or no width along X.
Procedural rows¶
Generated shapes with a Height in meters, made of Items:
- Wall items
- Extrude a 2D Profile along the side, for cornices, bands and ledges. Offset Y and Offset Normal move the profile up and away from the wall. Smooth Shading Angle shades the edges between faces smooth when the faces meet at less than this angle, and sharp above it.
- Where a wall item stops, at a corner or where the next side uses another wall, its ends are closed back to the wall, so mouldings aren't hollow when seen from the side.
- Base items
- A flat plate covering the whole footprint, at a height within the row (Origin, from 0 at the bottom of the row to 1 at the top, plus Offset Y), optionally pushed out past the walls (Expand). Use them for floor slabs and flat ceilings. A floor builds its base plates once, even when several walls have them.
Both kinds have a Material, and Flip Triangulation to turn their faces around when they show the wrong side. Wall items are UV-mapped in meters, along the wall and across the profile, so a tiling texture keeps its real size.
Editing a profile. The Profile graph shows the cross-section beside the wall: X is how far out from the wall, in meters, and Y runs from the bottom (0) to the top (1) of the row. Pick a Preset (Flat, Box, Parapet, Cornice, Chamfer or Pilaster) and click Apply to start from a common shape. In the graph:
- Drag points to move them. Hold Ctrl to snap in steps of 0.05.
- Double-click a span to add a point. Right-click a point, or press Del, to remove it. Two points always stay.
- Middle-drag pans, the wheel zooms, and F or Frame fits the view.
The Points list below the graph holds the exact values.
Corners¶
A corner closes the footprint at a knot. A wall's Corner section is used on every floor, at the start knot of each side that uses the wall. A row's own Corner replaces it on that row's floors. In other words, each knot is closed by the wall of the side that starts there. A corner trims both walls next to it, so the wall pieces stop where the corner begins.
- Convexity
- Which corners it accepts, seen from outside the building: Any, outside corners (Convex) or inside corners (Concave).
- Minimum Turn Angle
- Corners that turn less than this many degrees are left to the walls, for example the smooth knots of a curved footprint.
- Path
- The corner's shape seen from above. Sharp goes straight into the knot and out again, Round follows an arc tangent to both walls, and Custom follows your own Custom Points.
- Inset is how much wall each side gives up to a Sharp or Custom corner. A Round corner uses Radius instead, and the trim follows from the radius and the corner angle. Round Segments sets how many pieces the arc is made of.
- The plan view below shows the corner on a test angle, set with Preview Angle. With a Custom shape, drag its points there.
A corner is one of two kinds:
- Prefab corners
- Bend a straight prefab around the path. Model it as a flat wall piece with a vertical cut in the middle for Sharp paths (the cut lands on the knot), and with more vertical cuts for Round or Custom paths. The first piece that passes its chance roll is used.
- The piece field warns when the prefab has no cut in the middle, or when its mesh isn't Read/Write enabled: it then bends in the editor but not in builds.
- Procedural corners
- Sweep one or more Layers along the path. Each layer has its own Profile, Material, offsets and Smooth Shading Angle, like a procedural wall item. Bottom Margin and Top Margin leave part of the floor height empty, so several layers can stack.
If some walls of a volume have a corner and others don't, the building inspector points it out: the knots where a wall without a corner starts stay open.
Checking the result¶
The top of the Building inspector sums up the last generation: how many prefab pieces, procedural pieces, corners and roof pieces it made, on how many floors, and how long it took. Below that, it lists the problems it found, errors first. Click one to jump to the field that causes it. It reports, for example:
- a missing footprint, a volume with fewer than three corners, or a volume without walls,
- footprint sides that got no wall,
- a wall entry with no wall asset, a Chance of 0, or an Explicit Knot Start past the last knot,
- a row shorter than the floor it shares with another wall's row, which leaves a gap above it: give rows that share a floor the same height,
- volumes that overlap at the same height,
- Single slots that didn't fit their side, with the length they need and the length that was left,
- walls or roofs that have problems of their own: select the wall, or expand the roof, to see them.
Stretching filler slots that didn't fit a short side are only reported as information: the other slots stretched over them, so the wall stays closed.
Layout Overlay¶
With Layout Overlay on in the Buildings panel, selected buildings show their layout in the Scene view: each footprint side in its wall's color with the wall's name (No wall when it has none), the floor lines, the corner paths with a label on each knot of the first floor, and the row of each floor on the side closest to the camera.
- Click a wall label to give that side a different wall: one of the volume's walls, or any Volume Wall in the project under Other Walls. The volume's Walls list is rewritten as explicit runs, so every other side keeps its current wall. The menu can also Open the current wall asset. On a building with a Rules Override, the choices are disabled: change the rules instead.
- Drag the dots at the corners of the first floor along the wall to set the corner's Inset, or its Radius for round corners.
- Drag the handles at the top of procedural rows, on the side closest to the camera, up or down to set the row's Height.
- Hold Ctrl+Shift over a generated piece to see which wall, row, slot or item and floor it comes from, and click to open that field of the wall.
The corner and row height handles edit the Volume Wall asset, so every building that uses the wall follows.
Generated pieces¶
Every generated piece has a Building Generated Piece component. For pieces that come from a Volume Wall (prefab pieces, procedural items and corners), its inspector shows where they come from (Generated by), with Open Source Field to jump to that field. Select Building selects the piece's building.
Author with baking off
With Auto Bake After Generation on, the pieces are replaced by one baked mesh, so there's nothing left to hover or inspect. Turn it off while you work on a building's walls, and back on when you're done.