Cobweb generator with geometry nodes Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
an easy way to tell a story in your scene is to show the passage of time so what kind of story is being told here it looks like somebody took a picture of a donut that they bought before eating it this one is interesting though what stop them from eating the donut how long has it been what do the cobwebs taste like i'm not going to answer these questions but i will show you how to make the cobwebs [Music] so here we are in blender i'm using version 3.2 for this one first thing you want to do is create a little scene and this can be pretty simple uh for instance over here i just have like a plane and then some cubes that i'm using as pillars the reason we want to do this is so that our cobwebs actually have something to interact with so once you do that just create a collection over here and make sure that everything is in the same collection if you don't know how to do that you can hover over your outliner and hit c to add a new collection and then you can just drag and drop your objects into it next thing you want to do is add in a curve so shift a add in a curve a bezier curve right here and make sure that's not in the same collection that your set is in ours is outside like this now we want to be able to draw it in our scene so to draw with curves you just want to select it hit tab to go into edit mode uh t will open up the side panel right here and you can come down to draw like that and this will let you draw wherever you want right now this is floating in the air so if yours is doing that you can hit n to open up the side panel make sure you go to tool and then at the bottom change depth from cursor to surface and this will let us draw onto the surface of you know all of our objects right here and this is what we want it will interact with your scene a little better so i'm just going to delete all of that and just draw one in the corner like this so now that we have this working we can go over to geometry nodes right here by the way you can get this on gumroad if you don't want to make it it's a product that i just released called scribble gen okay so select your curve hit new to add a new node tree and we do want to use the original group input right here which is just our curve like that all right so first thing we want to do is make it so that instead of just following our wall like this it's only paying attention to the start and the end point like that the easy way to do that is with the resample curve node and we can leave this set to count but we want to change 10 to 2 right here so now we only have two points just the start and the end point and it should be like a straight line and if we draw this other places too you can see it's basically just connecting the start and the end point now to make this a little easier to see let's add some thickness to our lines so we can do that with a curve to mesh node and for our profile curve we can use a circle curved circle right here so these are going to be way too thick i also don't need this many points to make up our circle because it's going to be very small so we can change the resolution to 3 and we'll change the radius to something smaller like .005 if you want to make this thicker you still can't see it well you can make it thicker if you want but web's pretty thin so i think this is fine now basically what we're going to do is put a bunch of lines coming off of our main curve right here and we want the end points of those lines to attach to each other and also attach to our scene let's instance some lines with uh an instance on points node right here and this will make everything disappear because it's being replaced by instances which we haven't set yet so we need to join this with our original curve with a join geometry node right here and we can just drag this over now we have our original curve back and for our instance we want to use a line so we can just pull this out right here and search for curve line now you can see it's only instancing on the end points and that's because we only have two points right here so we should resample this again let's just uh join that up but if we make this higher you can see it's going to start you know adding points we don't just have the endpoints anymore so we actually need to duplicate this with shift d like that and we can change this to length and i want this to be a little higher i'll set it to 0.05 and we're going to need this length for later so an easy way to keep track of this is by duplicating the group input and we can just plug one of the blank ones in and now when we go over to the modifier properties right here you can see we can actually change this over here so if we ever need this value all we have to do is duplicate this and then plug the length in and it will use this value right here now i'm going to change the length and direction of our curve so i'll get rid of the 1 meter on the z and i'll set the x to 0.5 and i found that this value just works pretty well at this scale right here which is supposed to be pretty close to a life-size scale even though these are angled differently they're both pointing the same direction so i want them to be kind of following the normal of the line so we can do that by capturing the normal right here with a capture attribute node like that and we'll bring in the normal and we want to capture a vector because that's what our normal is so we have to change this from float to vector plug this into the value and we can plug this into the rotation but first we have to plug it into an align euler to vector right here make sure that this is plugged into the vector and not the rotation now we can plug this into the rotation and you can see now that it's actually following the direction of the curve which is nice and this will make a little more sense later while we're doing that also i want to be able to control how many lines are actually here and we can do that with this selection so just drag that out and we can plug in a random value and just make sure that this is set to boolean now we can you know decide how many lines we actually want here i also don't want to put lines on the very end points so we can add to this selection with a boolean math node right here and we can leave that set to and and we want to select the end points so i'll grab an endpoint selection node right here and if we plug this in it'll kind of do the opposite of what we want it's only giving us the end points so we need to invert this selection we can do that with another one of these just duplicate that with shift d and change it to not which will give us the opposite and now we'll plug that in and now you can see that it's being instance on every point except for the end points and if we want we can even turn this up a little like that i'll just have this set to something like six this will make it so that when these are branching to the surface it just looks a little neater towards the ends right here so let's turn the probability down to about 0.5 so now i want to take all of these branches right here and make the end points snap to our surface so we want to set the position of those we can add a set position but first we need to realize these because they're all still instances so with a realize instance node and right now everything is moving so we want to select only the end points with another endpoint selection node and we can turn the start size down to zero and that will make it so we're only moving the end points now okay so now we need to put some points on our surface for the end points to actually snap to this is why we put our set into a collection so we can just drag the collection click and drag down into our node tree and we'll set this to relative and we can distribute points onto it like this i'm just going to realize this first because by default uh collections are treated as instances so we can plug this up now and preview this with alt shift and left click and you can see now we have a bunch of points being scattered onto our collection like this i want more points so i'm going to turn the density up to about 100 and these are all of the points that our cobwebs will be able to snap to so we want to be able to find out how close all of these endpoints of our branches are to all of these points we can do that with a proximity node and we don't want this set to faces we want it set to points because this is giving us points so now we should be able to plug the position into our set position right here and so all of the endpoints of our branches should snap to the closest point that we are getting over here and this looks very predictable like they're all kind of going in the same direction so there are a few ways to kind of change this right now they're all pointing in the same direction so we could rotate them around basically before we realize all of our lines we can use a rotate instances right here let's take a look at that and we want to rotate this on the y like that so they're all rotating around in this direction so we can select just the y with a combine x y z and we can use another random value for the y right here make sure this is set to float and you can set the minimum and maximum amount i want this to rotate around 360 degrees so this is radians right now instead of degrees and 360 degrees in radians is either two times pi like that you can type that in or you can type in tau tau and that's the same value they are connecting a little more randomly which i think looks good and you can mute this to see the difference like that another thing that i'll also do is change the source position right here that's going into our geometry proximity basically what we're going to do is take our original position right here and we want to add noise to it so we can bring in a noise texture and we want to add these two together with a vector math node right here so add the position and the color from our noise and if we plug this into the source position it will start to randomize like that we can change the strength of the noise with another math node and i'll set that to scale you can set it to multiply also if you want and it'll do the same thing and this is how we will change kind of like the strength of our noise but you can see it's kind of drifting around so we do have to add one more math node we'll set this to subtract and we'll subtract 0.5 and that will make it so the strength will kind of push it in both directions instead of just one like that basically they're not going to touch the closest point that they possibly could they're going to maybe reach a little further so i'll set this to maybe around two and i think that's a good default value we can also change the detail down to zero and i'll turn the scale up to something like 15 so this is starting to look a little better but one problem is that if we draw two curves close together they're never really going to bridge across to each other so we also want this proximity to be looking at our curves our original curve so this actually isn't too hard basically what we want to do is take this curve right here and turn it into points with a curve to points node and we can just plug this in like that so we could turn this to length and make it the same resolution here or we can just set this to evaluated and this will basically just pay attention to how many points we have here and kind of change the resolution accordingly so now we can just drag this down to be a little closer and we want to join these points from our curve to these points right here with a join geometry node and we'll plug that in right here and you can see now some of them are going to bridge across like that so one thing that looks a little weird is all of these are perfectly straight lines so real cobwebs are going to hang just a little bit so we can add some hanging over at the beginning right here after our first resample curve node the way we're going to do that is by changing the spline type we're going to change it to bezier this will just give us access to the handle positions and we're also going to change the handle type we're going to change this from auto to vector and now we're going to change the handle positions set handle positions right here and we can't change the left and the right handles at the same time so we do need two nodes one for the left and one for the right and now this will let us kind of make them droop like that but i want to change both of them at the same time so we can use a combine xyz and just plug this into both and now the z will let us make this like droop a little lower so one problem doing it this way is that if we have some short and some really long curves like this you can see that the short ones are drooping like the same distance as the long ones and proportionally it just looks a little wrong so what we can do is find the length of these curves and make it hang more if they're longer so that's not too hard we can use a spline length node right here and this just returns how long each curve is but you can't plug it in directly it just doesn't work right we want to capture this length before we start messing with the spline type and stuff so we'll bring in a capture attribute like this and we can plug the length in like that and now we can use this attribute and plug it in directly and now this is going in the wrong direction but you can see that they're all kind of the same shape so let's make this negative with a math node so it's drooping down instead of up change this to subtract and i'll plug this into the bottom and we'll subtract it from zero this will make everything hang down and we can change how much they're hanging with a math node set to multiply so if we set this to zero they'll all be straight and as you turn it up you can see they'll start to hang like that i want this to be a little more random so we can plug a random value into here like this and this will let you set the minimum and maximum length and i think for a maximum the sweet spot is about 0.2 now this is nice because if you have a bunch of curves that are all like the same length or around the same length they'll all be hanging like a slightly different amount and i think the variety looks pretty good so this is all we need to do to add hanging and i do want to make our branches hang too so we can actually reuse all of this you can just select it all like that and hit ctrl g to put it into a group and if you want you can access some of these values from the outside just by plugging them into the group input like that and then you'll be able to access them but for this example i don't think we really need to do that we'll just leave everything as is inside here and you can get in and out by hitting tab so let's rename this with f2 to hanging you could also change it by hitting the n button and go to node and change the label right here so now we can reuse this for our branches we can just shift d to duplicate and we can drag it over to the end right here and just put it after our set position and now all of our branches will hang just a little bit too so now what i want to do is put more lines coming off of our branches and make those bridge across to other branches so to do that we're pretty much just going to reuse a lot of what we did for our first branches so we can select all of this right here including this little reroute node and hit control g to add it to a group now we need to tidy some of this up so we have this position that's going in and that is coming from our proximity so we do need that but we can tidy this up by bringing this group input a little closer to where it's being plugged in and i'll just plug it in right there so that way it's not branching all the way across and we also have our original main branch that's being connected to our end right here that's what this long line is and coming from this hanging group node that's our branches so we can rename the outputs so they don't have the same name just hit n go over to group and we can name everything over here so i'm going to switch these around our main curve we can leave as curve this other one we can call branches and now it's a little more clear what's actually coming out of here i want access to some of the options from the outside so let's go back in here i want the probability right here and i also want to duplicate this over to right here because we're going to want to resample this if we want to instance more lines on our branches we're going to have to add more points because right now these are just lines that only have two points so we can resample this curve again drag this in here and change it to length now i want this to be the same length as our you know original so we can grab another group input and plug this in right here so we have access to it from the outside we can hit tab to leave and we'll grab another group input right here duplicate it over and we can plug the length in right here and also the probability and now we have access to both of those from our modifier panel and so now this node group should let us add more branches but let's use alt shift and left click to actually preview what each of these is so the first one is our main curve second one is the branches i only want to put new lines onto our branches so we're going to plug the branches into our geometry right here and now we can do the same thing over here so this first curve is basically what's coming from our you know input the second one is all of our new branches but it's not working because we haven't set the position right here again this position is going to be the proximity basically all of the stuff we wanted to connect to we want it to connect to these branches so we can do the same thing we did over here where we turn our curve into points and we get the proximity of those points so let's just bring those two over right here we'll turn our branches into points and plug the points in right here and then we can plug the position in like that and now it seems like it's working let's just join our branches in right here and take a look at everything let's try drawing some new curves to see how it looks if you look closely we can see that some of the branches do have some other lines kind of bridging across now and again we can control the probability and the length and all that just take this and plug everything in now if we want we can add a third layer of branches and now that we did the second one it should be pretty easy we can basically just you know duplicate this take the branches like that and again we want to you know only use these branches right here so we can plug that in and again these are all going to be going to the wrong point until we use these two nodes so we want to turn the branches into points get the proximity and use the position right here it'll be a little more apparent when you make this quite a bit longer these are the third branches right here basically every time you add a level they're going to be a little shorter and so there will be like fewer of them so i think three layers is enough again let's just use our group input so that these are consistent and i also want to be able to control how strong our noise is from the outside too so let's duplicate this input and we can plug in the scale right here so now we can control that from the outside to make this branch even further if we want let's see how this actually looks in other situations now we can try it on you know this this person right here and i think it looks really good over by the pillars especially when you get some of these branches across we can turn the scale up too if we want to spread across more and this should work on ceilings also because of how much they hang so you can see that is working on the ceiling it won't work on floors very well because they're going to hang through them like that but you know cobwebs on the floor doesn't really happen that often anyway it's going to be more for like corners and ceilings and things like that so yeah now you can make all of your scenes look like they've been abandoned for years and years if you want to download a more robust version of this cobb web generator check out scribblegen on gumroad it has a few other presets like brick walls chains and barbed wire and they all have a bunch of options to change their appearance you can get the file that i made in this video on patreon where you can also watch my videos early get coupon codes for free products and files that i don't share anywhere else i also donate a portion of the profits to environmental causes each month links for everything are in the description i'd like to thank my patrons for their support and i'd like to thank you for watching have a good one
Info
Channel: Joey Carlino
Views: 64,304
Rating: undefined out of 5
Keywords:
Id: ziULQfSnTs0
Channel Id: undefined
Length: 20min 45sec (1245 seconds)
Published: Wed Aug 17 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.