hi there welcome to the first of a two-part tutorial where i show
you how to create a fully procedural city and blender using geometry nodes
i like to keep things organized from the start so let me create
some collections and give them proper names
now i'm going to add a play and extrude its edge twice
along the x-axis this mesh is the starting point of a single city block
to add some buildings to this block i'm going to add a geometry node modifier to it
and switch to the geometry nodes viewport
now to understand the concept of geometry nodes it helps to look at this viewport as a factory
with an assembly line that moves from left to right this assembly line takes an input
and procedurally converts it to the desired output by modifying it along the way in our case
the input is the plain mesh i created earlier and the desired output is a city block that contains
buildings with different shapes and sizes an easy way i can demonstrate this concept of an assembly
line is to add a node called point instance what this node does is that it takes the input geometry
and places an object of our choice on each of the vertices of that input geometry
so if i select the default cube as the instancing object of this node and then place this node in
the assembly line we immediately see that instead of the eight vertices that we originally had
we now have eight instances of the default cube at this point we have a single city block with eight
buildings in it however all the buildings look the same and this is not what we want
we want to have some variation among the buildings and specifically we want
our buildings to have different heights we can make this happen by adding more geometry nodes
in the case we have here where we want to create buildings that are different in size
we are specifically interested in the scale attribute of our geometry and we want to
randomize the scale attribute along the x y and z axes so i'm going to add a note called the
attribute randomize node and place it in our assembly line and configure it like this
okay so at this point we have some randomized buildings however this is just a single block
and not exactly a city to make this a city i'm going to add some array modifiers
and make sure that these array modifiers are placed before the geometry nodes modifier
now this point we can go ahead and add some detail to our buildings
simply by editing the default cube i can either do this by directly editing its mesh
or by using non-destructive boolean modifiers the choice is up to you however i personally
prefer to take the non-destructive route because it makes it easier to make changes in the future
do
now i am not limited to only having a single type of building
i can actually have multiple types by adding more objects to the building's collection
i can then tell the point instant geometry node to use any of the buildings inside this collection
however one problem is that all the buildings are facing the same direction
i can fix this by randomizing the rotation attribute of the geometry
specifically the rotation about the z-axis to do this i use an attribute randomized node that
rotates the geometry only about the z axis by some amount ranging between 0 and 2 pi radians or 6.28
do
and to have this rotation at fixed steps of 90 degrees i use a node called attribute map range
and set the mapping to be a stepped linear function
now i want my city to have a central business district
or a cbd where the buildings closer to the cbd are taller than other buildings to do this
i will create a new collection called cbd and add a single vertex to it
then i will go back to the geometry nodes graph
and add a special node called the attribute proximity node
this proximity node along with an object info node
allows me to calculate the distance between a building and the cbd vertex
on the attribute proximity node make sure to change the setting from faces to points and on the
object info node make sure to change the setting from original to relative i can then construct
a new scaling vector by using an attribute map range node and an attribute combine x y z node
finally i can combine this new scaling vector and the randomized scaling vector from before
by multiplying them using an attribute vector math node
now the tallness of the cbd buildings
and the size of the cbd area can be modified through the geometry nodes
and the location of the cbd can be changed by moving the cbd vertex
and as a bonus tip i will now show you how you can have multiple business districts in your city
this was the first part of a two-part tutorial on creating on procedural cities and geometry notes
in the second part i will show you how to add procedural materials to your city
so don't forget to subscribe to be notified when the second part comes out
and that's it for this video as always thank you for watching and until next time take care you