Getting started - part 1¶
This page is a must read when you start to use SceneCity. Follow it step by step.
In part 1 you will learn how to create a city for far-away shots. They are simpler and faster to make, but less precise, with overlapping buildings and roads. In part 2 on the contrary you will learn how to make cities with buildings and roads that never overlap and are more suited to closer view or navigation in the streets.
Almost all features of version 1.1 are available in the new and more sophisticated nodes workflow introduced in 1.2. What’s missing is the more advanced procedural buildings generator and the random assignment of materials on meshes/objects. All features will be converted to nodes progressively, but in the meantime you can use both the new and the old interfaces, see here for v1.1.
Install & enable the addon in Blender¶
Buy the addon from Gumroad. Then download the zip file, do not extract it. You just install it in Blender as it is:
- open Blender’s User Preferences, from the File menu
- in the “Add-ons” tab, click the “Install add-on from File…” button at the bottom, and select the zip you downloaded
- check the box next to the addon to enable it
- optional: click “Save User Settings” at the bottom so it’s always enabled each time you restart Blender
You now have SceneCity correctly installed. You’re ready for building cities.
Create a graph and add your first nodes¶
The first thing necessary is to create a SceneCity graph. You can think of a graph as the description of a city. You can have as many graphs as you want, and you give them a name.
In a graph are nodes, connected together via sockets. Each node does something specific. Some of them need some kind of input to work, and then they output one or more results. You connect nodes together, you chain them, so that you can tell what operations to perform, and in which order.
Some nodes can create fresh new data (a new texture set, or a procedural cube mesh). Some nodes are useful to get data from Blender (eg. load a mesh or images). Other nodes let you transform that data (eg. by instancing roads and buildings, drawing into images etc..). Finally other nodes let you output your transformed data back to Blender (eg. create or update a Blender mesh).
It is important to make the distinction between Blender data, and data which is internal to SceneCity. Therefore to avoid confusion, I will explicitely say when it’s Blender data, such as a Blender mesh, as opposed to mesh data for example, which is the internal representation of a mesh in SceneCity.
Add the following nodes to the graph:
- City meshes ==> Procedural cube mesh
- City layouts ==> Simple buildings layout
- City meshes ==> Mesh data -> object
Connect them like in the image below, set the noise subtype to Cells, then click on the Create / update mesh and object button. In the 3d view you’ll see a city appear, select it and scale it down 100 times (scale 0.01).
Let’s see how that works. The central node is the most important one: the layout. A layout in SceneCity is a method to mass-place buildings, roads etc… Anything that makes a city. You’re using the simple layout, this one places buildings only, and randomly without checking for overlap. On its left is a procedural cube. You’re feeding the layout with a procedural cube for its Building mesh data input. As a result, everytime the layout needs a building, it asks the procedural cube mesh node to give a cube as mesh data, with the desired size. Finally on the right, you’ve added a node that can convert mesh data to a Blender mesh and a Blender object in the current scene and active layers.
Blender is frozen while the simple layout node is working, but if you open Blender’s console you’ll see its progress displayed in realtime.
When you want to know more about any particular node, simply click on the Node doc button, it is a direct link and will open its doc page in your web browser, so do not hesitate.
Make the city layout more interesting¶
Right now the layout creates the buildings in a very homogeneous way. You can change its parameters, but in the end, all the buildings look more or less the same. So let’s fix that.
A layout can be controlled in space. That means that you can tell it where you want things to be different. The simple layout can be told where we want tall and small buildings. And where we want no buildings at all.
Add the following nodes to the graph:
- City maps ==> Procedural map
- City maps ==> Map -> Blender image
Connect them like in the image below, then click on the Draw map in image button. In the UV/Image editor panel, select the newly created image to see it.
With those two nodes, you’ve created and visualized a map. A map is a 2d area of values. It is continuous, which means unlike an image it is not a raster (or an array), and can have an infinite amount of details. This is exactly what the procedural map node is for, it creates a map based on a procedural noise function. In this example you did set the cells noise. The second node draws a map into a Blender image.
Let’s use the map, connect it like below, and re-create the city.
Now your city has a lot more interesting patterns. Notice that where the map is black there are no buildings, and that lower / darker values produce smaller buildings.
Add textures to the buildings¶
Our buildings are boring to look at, let’s give them some colors.
First, we need to be able to apply different materials to the facades and to the roofs of the buildings. Set the procedural cube parameters like below, then re-create the city. Verify you have two material slots for the city mesh.
What you just did is:
- scale down the size of the UVs for each face of the cubes, this will increase the size of our facade texture displayed on the buildings in the next steps
- set the UV unwrap mode to the one most random-looking
- enabled random UV translation to diminish visual-repetition
- set the material slot index to 1 for the top and bottom faces of the cubes
Secondly, let’s create the facade textures. Add the following nodes, connect them like below, and click the Create / update images button:
- City textures ===> New texture set
- City textures ===> Random rectangles drawer
- City textures ===> Simple windows drawer
- City textures ===> Texture set -> Blender images
Now you have in place a mini-pipeline of drawing functions. The first node creates a new blank texture set, which is a collection of textures for a PBR material. Then you draw random rectangles in the albedo channel of the texture set, to add some interesting patterns. Then on top of it, you draw facade windows in both the albedo channel for the unlit windows, and the emit channel for the lit windows. Finally you output all the channels into Blender images, so they can be used in materials, and saved as image files.
Let’s create the material now:
You can turn on the emit channel for night shots, and off for daytime. With a bit of work you can make the materials more elaborate to increase realism, like adding detail textures, make the windows reflective etc…
Use your own buildings and combine layouts¶
Using random cubes is great to quickly have simple buildings, but their shape remains very simple. Let’s add our own buildings, made by hand so we can have them a bit more complex, such as this low-poly building for example:
Create or get a building of your own, take note of its name, and its size. Then in the city graph add two new nodes, plug them like below, and adjust their settings:
- Another simple layout node
- City mesh ===> Blender mesh -> mesh data
What you did is create a new layout, and chain it after the first layout using the Previous mesh data input socket. That means that when the second layout does its job, it appends its result (in the form of mesh data) to the result of the first layout. Moreover the second layout takes its building mesh data from another node, which itself converts a Blender mesh, in that case our custom building mesh, to mesh data.
The new layout has been adjusted to scale our building according to the scale at which it has been modeled. The example building mesh is 1/10 of its real size, if one Blender unit equals one meter. So it must be scaled up about 10 times in the final city mesh, to be consistent with the previous buildings cubes. In the example I set the layout parameters a bit larger (20 and 30 for XY size mult and Y size mult) on purpose. I also turned on random rotations for each building instance.
Re-create the city (it will take a bit longer, especially if your custom building is high-poly, so watch the console), and you should now have two different buildings mixed in the same city mesh.
What would be a city without roads! We’ll add simple ones. They consist of a road portion mesh repeated along several curves using Blender modifiers. The curves will loop, and never branch, so there won’t be any crossing. They don’t test for intersections either. But they will look intricate nonetheless, and will give a very nice result for distant- or middle views.
First you need a mesh of a road portion
Due to the way the curve and array modifiers work, it is not possible to scale the objects following the curves without having them not be repeated enough times (or too many times if scaling up) to cover the full length of their curves. Therefore, it is important to have your road portion mesh be modeled at the exact scale as the final scale (so model it with its object scale = one). In that particular example, since my city is scaled down 100 times, I model this road portion directly at the scale of 1/100. Inconvenient, but there’s no way around it that I know.
Now add 4 new nodes, and connect them like below:
- City paths & curves ===> Path generator
- City paths & curves ===> Paths -> curves
- City paths & curves ===> Curves -> objects
- City paths & curves ===> Objects repeated along curves
Set the mesh portion on the last node, then click the create buttons on both last nodes. This should give you this kind of result
When your scene starts to be cluttered with many objects created by SceneCity, remember that all create operations create the new objects in the active layers, so you should put the roads and buildings in different layers for easier scene organisation. In addition, don’t forget to name your objects with the nodes’ text boxes made for that purpose, as this will make your job much easier AND the delete operations (such as those on the last two node) find the things to delete based on their name.
Congratulations on completing this firt part! You should have a good understanding of the way SceneCity works. You can now play with the settings, combine more layouts and buildings, build larger scenes, and you don’t have to stop with SceneCity. It’s there to help, but doesn’t stop you from editing the city by hand. You can add the city onto a terrain, add lights and lit billboards for night scenes, go crazy with very tall buildings sci-fi style, or export it to other software for rendering.
The great thing about nodes is that you can use and combine them anyway you like. In this page you’ve learnt the main nodes and their most obvious uses. But there are more nodes (and therefore more features), and each have many options. So you should start experimenting and playing with nodes, change their options, try new ones.
Here is an idea: why not animate cars along the roads using their curves, and render an animation.
In part 2 of the tutorial, you’ll learn about non-overlapping cities.