How to Make Lightning, The Procedural Way || Blender 2.90

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone i have a lightning pack for sale on gumroad right now but if you want to make it for yourself instead of buying it keep watching the file on gumroad will have a few variations and built-in animations if you grab it there if you have ideas for more tutorials or things you'd like to see in my shop let me know in the comments i'd also like to thank you all for helping the channel past 400 subscribers when people comment and subscribe it lets me know that this content is worth producing all right let's make some lightning all right so here we are in blender 2.9 we just have our normal scene right here and i'm just going to delete everything in it and we just have this one collection right here so first thing i'm going to do is add in a plane go into edit mode and press m and collapse it so it's just one point right there make sure you press 1 to go into vertex edit mode i'm going to press e to extrude on the z axis and type in 10. so right now we just have this line this edge that's uh 10 meters tall and i'm just going to add some loop cuts with a control r i'm going to add seven cuts right there so we have uh like eight edges right here next you're going to want to click on this bottom vertex right here and go over here to object data properties to add a vertex group i'm just going to name this focus and this is going to be the tip of our lightning right here so i'm just going to assign that make sure it has a weight of 1 and you're just using that one vertex right there and then i'm going to go back into object mode so i'm going to start adding some modifiers and the first one i'm going to add is a displace this might look a little different for you if you're not in 2.9 over here but i originally made this in 2.8 so whatever version you're using hopefully it should be fine i'm going to add a new texture and go over to the texture tab and i'm just going to add a cloud texture and right now you're not going to see this working because it's trying to use the normal direction and since this is just a line right now it doesn't really have it doesn't really know what direction to move in so i'm going to choose x and i'm also going to add a subdivision surface modifier and move it up and this will give us some extra geometry and if you want it to be more smooth you can just move the viewport and render up i'm going to do that until it's about four you can see we have a lot of detail right now but it's really but you can see it's like a very small and noisy texture so i'm just gonna go back into the texture tab over here i'm just gonna turn this up to something like one or maybe 1.5 right now and if you want to be smoother turn the depth down if you want to be a little more noisy you can turn the depth up right there and for the coordinates right here we have it set to local but i'm actually going to change that to object and right now we don't have any other objects in our scene so i'm going to add so i'm going to add an empty and i'm just going to use a plain axis for this i'm going to move it up and put it over here and i'm going to name this control bolt disk for displace i'm also going to name this bolt mesh for lightning bolt so go over to your lightning bolt and just choose that empty we just made right here you can see when we move that our bolt will deform and we can use this if you want to like basically uh give the bolt a different shape and i also want to make this a little more intense so i'm just going to change this to like 2.5 we can see it's a little more wavy right now and i'm just going to duplicate this modifier a few times with shift d so we have three of them now the first one is using the x direction the next one i'm going to use y and this one i'm going to use z so now we have it moving all over in every direction and for the z i'm just going to change this to 1 because i don't want the z to be as as intense and right now this is still just an edge so i'm going to toggle all these so they're small and we want to give this some depth so i'm going to add a skin and right now we're in wireframe when i'm going to go into solid view and you want to make sure this is after all of the displacement or else as you can see it's not really going to look right then i'm going to go back into edit mode switch over to uh make this transparent with all z i'm gonna select that bottom point right here make sure proportional editing is on i'm gonna switch that from smooth to sharp and i'm gonna press ctrl a to uh scale that down just gonna hit zero so it's completely sharp and then scale this up until it's about as big as we want so i think that should be good now it's looking a little more normal but it's pretty uh geometric right now so i'm just gonna hit smooth shading and if you want that to be even smoother you can just add a subdivision surface after that like that and if it still looks a little too jagged you can just up your resolution over here or change your uh your displacement texture so now you can see that this is not touching the original point that we want it to be touching so in here for vertex group i'm just going to set that to focus and it's still not working because we need to invert this and we need to add this vertex group to each of our displacements so now you can see it's touching our uh our origin point right there and if you want this to be a little easier to control you can add another empty i'm just gonna add a circle rotate it 90 on the x like that and i'm just going to parent both of these to that circle ctrl p now whenever you move this everything else follows like that and if you want this to be shaped differently you just move this around right here another cool thing about this setup is if you want this to have multiple branches you can just go back into edit mode and start extruding some points right here like that and now we have some points but you can see they're still like kind of fat at the end so if you do that just select all the points you just made at the end with a shift and left mouse button like that and then uh ctrl a and scale those down to zero and if you're in proportional editing make sure this proportional size up here you might want to make that a little smaller like that now it looks like lightning next step i would say is shading so we can just go into our shading tab over here and i'm just going to use evie for this this should work fine in cycles too but evie is a little faster so i'm just going to click on our lightning bolt and add a new texture up here i'm going to delete the principled bsdf and add in a mix shader we're going to mix two shaders together one of which is an emission and the other one is a transparent and you can just plug those into those two shader slots right here and also for the transparent to work in eevee anyway you have to press n to go into the side menu change this blend mode to alpha blend and i'm going to turn the shadow mode off so it doesn't have a shadow you can also do that down here in the material properties there should be a spot for it over here so what we're going to do over here is the animated part of our lightning and basically we want our lightning bolt to be completely transparent and then look like it's uh traveling down to the point and then going away so to do this i'm going to add in a vector math right here and we're going to use length and what that does is uh it just tells us how far away things are from the origin point and for it to work with our origin point we have to add a texture coordinate and set that to object and that just uh makes everything kind of based around our origin points over here so if we add a math node now and set that to greater than we'll be able to visualize how far away things are from that origin point and when we made our first line we made it 10 meters tall so we know that this should be 10. if we do 10 this should be completely black i like to turn this to 11 because with all of these things being displaced and deformed sometimes you get a little white up here when it's at 10 so i just set it to 11 just to be safe and so if we plug this now into our factor and plug that all in we can see that the greater than is controlling that but it's going in not the direction i want it to go so i'm going to change this to less than instead and now it seems like it's traveling in the right direction like that and what we're going to do is turn this into a node group so to make this a little more organized what i'm going to do is add in an invert node because i want to use a slider to control this so it's just basically on and off we don't have to know that it is to be turned up to 11. so i'm going to add another math note i'm just going to duplicate this and set this to multiply and make sure the second value is 11 and plug this in here and basically to understand what the invert does is it's looking at this color and inverting it so if this is black which is zero um this should actually be accurate where when the factor is zero it's zero and when this is one it's inverting it making this white so if we set this to white it's basically going backwards now where zero would be one and one would be zero so what i want is when this is zero this looks completely off and so i think i need to turn this white to do that and now we can see that zero is off and one is on and anywhere in between if we animate this it's like traveling through the bolt so i also want to be able to control the opacity and to do that i'm going to add in another math node i'm just going to keep that set to add and clamp that if we set this to zero it's completely opaque and if we set this to one it's completely transparent how i want this to work is when it's at zero it's completely transparent and when it's at one it's completely opaque so once again i'm gonna use another invert node right here and we're going to leave that set to white so that this value right here is inverted plug that in and it should work fine like that so now we have uh opacity control control of how our bolt travels through that shape right there and we have color and strength too and that's pretty much all you need for this so i'm just going to select everything except this uh texture coordinate and i'm going to hit ctrl g to group that i'm just going to set this up real quick so press n to go into these options right here go to node i'm going to change this to vector object so we know that this should be using object coordinates and plug this into the factor and change this name to bolt length going to plug this one in and change this to opacity we want to control the strength of the emission and also the color and then when we go out we have all the controls we need right here and you can change this color too like that and i'm just going to rename this lightning bolt and next i'm going to show you how to animate this so i'm just going to bring a timeline up down here and we're just going to make something that looks kind of like this so at frame 1 i want the length to be zero so i'm going to insert a keyframe there with i make sure that's selected so we can see our keyframes too over here and we want this to travel down so here i'm gonna set it to one right there and it's moving pretty slowly so you can just drag this other keyframe over a little until it's the speed that you want so that's looking pretty good but i want that to be linear like that i'm also going to make sure the opacity is set so that when it strikes we can make it fade out like this now as you can see over here there are some like overlapping little bits and you can change that by unchecking show backface hopefully that works and if you want this to be brighter you just turn the strength up so if you want this to look like it's bridging electricity like with a jacob's ladder or tesla coil you can just select all these and duplicate them like that you can tap back into edit mode and add this other one at the top to your vertex group so now the top and the bottom will stay in place even if you move this like that you would want to uh add a new material just duplicate this with this uh with this button right here and remove all of these keyframes here and instead of animating this you would want to animate this right here another thing i'm going to do is just get rid of all of these and if at any point your skin modifier gets messed up you just have to select one of these vertices go over to your skin modifier and hit mark root and it should work again so an easy way to animate this without adding any keyframes is to select it and then go over to your location on the side for this i'm going to use the y location just click on that and type in frame and hit enter and it'll match your current frame so if you move this now you can see it moving and if you want it to go slower you can just divide it by some number so 50 seems too high maybe five it's a little better and now we have this like bridging electricity and if you want the top to be sharp too you can just tap into edit mode ctrl a and scale that down to zero also like that now it looks a little better to add a little more detail i'm just going to tap back into edit mode select everything duplicate it i'm going to change this interpolation over here to smooth again and make sure you have that checked choose the middle one i'm just going to move that over to the side like this but you want to make sure that connected only is there then it looks a little like this and you can just do this a few times to get multiple branches like that and that's all there is to it once again you can grab the lightning pack on gumroad with some pre-made animations as well as my glitch effect nice guy hdri pack and a bunch of free wallpapers give me a follow on instagram to see what i'm working on links are always in the description have a good one see ya
Info
Channel: Joey Carlino
Views: 41,939
Rating: undefined out of 5
Keywords: blender, cg, cgi, blender 2.9, lightning, procedural, generative
Id: dblHLxyE7BU
Channel Id: undefined
Length: 14min 53sec (893 seconds)
Published: Sat Sep 05 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.