Easy Procedural Sci-Fi City Tutorial - Blender 2.9 EEVEE Geometry Nodes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everyone and welcome back to another tutorial well today i thought i would show you how to go about making a procedural city using the geometry nodes in blender which is a really powerful tool and you can do a lot with it but something i found really cool to create with it are these very simple but very effective looking cities where you control the density the shape the layout of cities very very easily without loads of faffing around just a couple of tweaks to some of these settings once you get it all set up and you have complete control over it to get something like this and today i'm going to be showing you how to create this simple setup without any materials but also having a look at how to create these sort of city lights down on the street level as well if you are interested in how to make the materials for the buildings as well i will also go into that on another tutorial so please let me know in the comments if you're interested but for now let's get started with our scene so let's go ahead and open a new blank scene up we're going to delete our default cube and before we do anything let's change our light to a sun and under shadow check contact shadows always a good thing i think to do for setting up scene and just change that strength down to five because a thousand will just wash everything out let's add a mesh at a plane scale it by five for no reason whatsoever and that's gonna act as our base for the city now if we switch over to the shading tab that probably gives us the best default layout for the windows we're going to be using so just go to shading and you'll see our scene set up here in the material preview and what we want to do is add a mesh and add a single cube bring that up on the z axis by one and we're just gonna move this off to the side this is gonna act as one of our buildings we're gonna use to procedurally populate that plane with now i'm just gonna turn on cavity within our viewer here just so we can see the edges a bit more and we're going to duplicate this cube with shift d move this over so we've got a couple of variations to work with now going back to our plane here before we go into any detailing on the cubes we're going to select our plane and change the shader editor over to the geometry node editor add a new system what this is giving us here is basically it's saying group input which is our plane and the group output which is what it's going to be putting on top of the plane now we want to obviously tell it what to add in the middle here so what we want to do is say yeah we want the cube to appear on the plane in the middle so what we're going to do is go shift a and we're going to add first of all an attribute and an attribute randomize and then we're going to go to shift a add a point and a point distribute node that's going to go before the randomize and then add and a point instant node as well so it's going to go point distribute attribute randomize and then point instance at the end connect the geometry to the point distribute distribute the randomizer randomized to the instance and if we connect this straight to drum g you'll see our plane disappears and that's because we're basically replacing the plane with whatever object we're going to select here which we want to be our cube but it's basically saying we only want the cube to appear we don't want the plane obviously that's not true we want to ground so we want to mix the plane with this new cube we're adding in to go to add geometry join geometry node i'm going to connect the group input into the top one that point instance to the second connect them both and you'll see if we move the density down to zero we've got our plane here as well and it will also add the cubes on top now these cubes are way too big so what we want to do is change the attribute randomizer vector type in scale to the attribute and what this will allow us to do is manually control how big and small we want the cubes to be [Music] as you can see they're still way too big so we want the minimum value will be how small the smallest cube will be and the max to be how big the biggest one will be now zero is nothing which means that some cubes might not be appearing at all so let's add in a small number like point one and then the max to be 0.2 which is looking pretty good but maybe slightly too big still but if you see if we increase the density now it's going to add more cubes in but let's change this down to maybe something like point zero five and that's looking pretty good now one thing we want to actually do is press ctrl a and apply the scale because we've scaled the plane up by five and now you'll see the cubes are all appearing in the size they should be relative to the plane and that's looking pretty good you see if we uh change the settings now for the z-axis on the max we can control the height and the x and y we can change how stretchy they are now this is up to you obviously how you want to stylize your city but i try and keep them maybe in a sort of cube looking shape and for this sort of mass of smaller buildings we want the zed to be quite low as well let's just rename these cubes first of all we want one to be small building and the other to be tool building at the moment it doesn't matter which one you change it to because they both look exactly the same now what we want to do is we've got our low level base of cubes down here but what we want to do is populate some taller cubes in as well so the way we want to do that is duplicate the geometry node setup we have which is selecting these three press shift d to move them down and we want to reconnect everything again so if we connect these two from the geometry to the point distribute now a little trick you can do here actually see if you press ctrl and then click through you can actually create a little point so that the lines aren't intersecting with everything which i find is a really useful technique now we want to duplicate that join geometry join these two setups we've got and then connect that up there again so we're basically combining these two geometry setups and saying all of this needs to be applied to the plane now what we can do this whole these three nodes under the bottom are all separate so we can change the density change the seed change the scaling and it will be completely separate from the one we've got above so we can have maybe less buildings but have them taller and this just gives us that control if we switch over to material preview and actually make sure you switch on ambient occlusion bring that distance up turn the blue on turn the screen space reflections up and you'll see that yeah we've got a nice mix of a load of smaller buildings and then fewer taller buildings just adds that nice bit of variety in there if we add a new plane and scale it up by five um just so we get a nice sort of base there stretching out further and there we go that's kind of the basic setup for our city really but what we're going to do i mean this is as far really this is the core theory behind it so take this if you want and go crazy with it but i'm going to show you a few more little details you can do now so obviously we've got two different cubes what we might want to do now is start detailing our models so you can really customize them to look how you want so if we select this cube which is tool building and you'll see it will select on the plane which ones are still building we can add some loop cuts in with ctrl r with the face select tool press alt and shift and we can select these sort of rings faces and then pressing alt e we can extrude along the normals bring them in a bit and then you'll see that on all of the cubes that are being distributed from the geometry node setup um it will start changing the same way we can insert here with i maybe rotate that roof bit and it's just adding a bit more detail into that city now so they're not just plain cubes and that's looking really nice so we can do the same sort of thing with a smaller building maybe just press i to insert that roof there and then press s to scale along the x-axis and then e to extrude up just so we've got a bit of a bit more detailing and go as crazy as you want with the detailing of course but that's sort of basic enough i think for now just to add that little ball a little bit more extra detail in there just looking nice we can just populate that density a bit more for both these really push the city up but what's great about this now if we scale this up by two and then press ctrl a to apply the scale it will reapply the settings and you'll see we get more buildings in the density and our city is getting much bigger and you could keep scaling up bigger and bigger keep applying that scale and you can have a huge huge city and that's looking really cool like it just with two cubes that we've made we've now populated randomly this this city i'm just gonna add a material here just so not everything's as bright white just bring the color down to sort of a darker gray just select those two cubes and remember everything you do to those two cubes will automatically apply an update to the entire city which is really really cool just the power and freedom you have over it to really quickly make changes that are really gonna affect the city without having to go in and manually change everything bit by bit you can just change one thing about the cube and everything will update now what we might want to do now is we're going to add some roads in you know add some sort of city lights down on the street below so let's add a mesh at a plane scale it up by 10 which will be the size of the the city because we scaled it by five and then scouted by two and let's bring this plane up so we can see what we're doing now the material we want to create here a little technique we want to do where we basically want to add an emission shader to act as the lights but then we want to use a transparent shader as well in order to cut away now this technique you can use it for a whole load of things you can make grates you can make sort of digital cells if you want but for now we're using it to make cities but just i want you to use your imagination think about what else you could do with it i might make some other tutorials on that but essentially what we want to do is if we add a shader in add a mix shader we want to say we want to mix two together but before we do this actually we need to go to material and change the blend mode to alpha blend and let's change the shadow mode to none because we don't really want any shadows now what this will do if we change the factor you'll see it'll switch between the glow of the emission and the transparency which even that on its own looks pretty cool i don't know what you could use that for but there you go there's an idea um but obviously we don't want it to be all or nothing we want to basically cut out the emission using a texture so let's add a texture in a voronoi texture pop that in there and then what we also want to do is add a converter a color ramp so we have control over how harsh the sort of cutaway is and plug that color into the factor and you'll see now if we bring this uh scale up and then bring the black value up on the color ramp we're starting to cut away the transparencies using that texture in order to figure out where it wants to cut away and that looks really cool i mean not for the city that we're creating but again just uh something might inspire you for something let's bring that randomness down to zero and if we press ctrl t on the voronoi texture it'll bring up a mapping node and we can further control the scale even greater now what we want to do here actually is we want to stretch this texture we want to stretch it but before we do that let's change this bronzo texture to 4d instead of 3d change this to chebychev and we're getting this grid sort of texture if we increase the randomness on it and bring the white down so the emission is coming through harsher now what we want to do is switch over to the scale on the mapping node and like i said before it's really stretch the y to a high number and then bring the x value down to something really really small like point one not zero necessarily but something like point one so we get really nice sort of stretchy lines that are a bit randomized they're not completely straight and just bring those values up and this is up to you how you want it to look [Music] change it how you want i'm gonna bring that randomness down a little bit and let's change the emission color to be an orange something a bit more sort of like street lights glowing in the city and that's looking pretty good i mean this is up to you now how you want it to look so we've got the lines going one way but if we select the plane shift d to duplicate rotate on the z by 90 select both of the planes now and let's move them down onto the city layer sort of street level i guess [Music] just have a look there get it in line so although these objects are completely separate because they're using the same material there what we can do is continue to adjust the settings actually let's just rename these so we know that both of these planes are the right ones so although they're completely separate objects they're using the same material so what we can do actually is once we've selected uh our material we can just change the scale again and it will change it for both of the planes so we can make the streets as detailed or as simple as we want to remove that density there we can see what's going on yeah you just get this kind of cool looking grid city a bit more sci-fi than normal i guess um but yeah sort of sci-fi looking street view and what we could do actually is if we uh duplicate these and bring them up what you could do is create the illusion of you know spaceships or almost like higher layer city traffic through sort of spaceships flying around a bit like coruscant in star wars and um if we just bring the the black value up so there's not so much of it kind of get the illusion here that this sort of traffic floating through the uh through the sky and if you were to animate the location of the mapping node you could create the illusion that traffic is moving but yeah just a little tip there if you're interested in creating flying spaceships from far away you know obviously up close it's not gonna hold up but from far away sort of bird's-eye view of the city that would work that's looking pretty cool but uh anyway that's the the flowing traffic we'll get rid of that if you just want it as a base level traffic we can delete that keep that traffic down on the bottom but let's change the material of this plane here to be that dark gray as well so we can actually see what's what's going on here there we go that's much better and there you go really you've got your your basic city nice and complex just by using two really really simple cubes what we could do as well maybe is add an array modifier to this taller building and you'll see again everything will update immediately but let's change the z the x to zero and push it up on the z and we'll get a nice bit of extra height on those buildings without stretching the geometry too much because we're using the array modifier so we could maybe bring the uh scale down and we're still getting that nice bit of height without stretching the geometry another thing we could do also we've got two layers of the city here we've got low buildings and high but we could add a third layer and we could bring these ones down to create sort of a mid-tier building duplicate this again and exactly the same technique as before link these up together move that over and then just joining the geometry so now we're going to join the middle layers at the bottom these up together and yet again we can change this separate bottom set of nodes and they will update completely independently of their own change the seed bring the scale up and now we've got low level buildings mid-tier scale buildings and then you know really tall sort of stand-up buildings on their own and you can keep going with this you can keep adding more building types more layers more densities different varieties of buildings and just go crazy with it just keep adding or changing whatever you want it's up to you there you go you've got your very simple and easy to control building creator nice and easy i hope this video was helpful in creating a basic setup for a city if you found it useful please do give the video a like and subscribe for more content like this i'd really appreciate it let me know in the comments of any other tutorials you're interested in seeing and that's it for now i've been toby i'll see you all in the next video [Music]
Info
Channel: Toby Rawal
Views: 12,024
Rating: 4.9649124 out of 5
Keywords: after, effects, after effects, blender, premiere, adobe, creative, film, eevee, dark following, ps5, rtx, tutorial, how to, cgi, city, procedural, geometry, nodes, 2.9, 2.93, material, model, easy, texture, nft
Id: SPHPAgXUnL8
Channel Id: undefined
Length: 16min 13sec (973 seconds)
Published: Mon Jun 28 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.