How to Make Sparks in Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I'll be sure to check this out. I have to admit, im still not as good as i could be when it comes to non- hair particle systems.

👍︎︎ 1 👤︎︎ u/MyNameIsBarryAllen 📅︎︎ Dec 31 2014 🗫︎ replies
Captions
today guys this is Andrew pricee from blender guru comm and in this video tutorial I'm going to be showing you how to create sparks now this is really really easy to do it's going to be a very quick tutorial we're going to be creating this result right here but using this same method you can use it to create a variety of different looking sparks so I went ahead and created a short 45 second animation using this method which I will now show you right now so let's go ahead and take a look okay so that just gives you an idea of how you could use this tutorial so we are going to be creating just this result that you can see right here so you can then go ahead and use that for any of your different projects that you're going to create but yet the the video I just showed you that's just an idea of something that you could do anyways this the finished scene right here it's very very basic as I explained to start which can be using this new particle info node which is a new feature in blender which lets us to change the materials of the particles as they animate so that's very cool um and yeah without further ado let's go ahead and get started so go ahead and open up a new scene in blender and the first thing we're going to be doing is creating the spark emitter so where the particles are actually going to be emitting from pretty self-explanatory so I'm going to go ahead and delete both that cube and the and that lamp there and I'm going to replace it with a cylinder okay and I'm going to rotate this cylinder 90 degrees I'm inside View mode right now so that's number pad 3 to do that and then what I'm going to do in in front view I'm just going to use the Box tool and I'm going to delete say a quarter three-quarters of it just like that so I now have just this segment right here now this is going to be where the particles are thrown from so that's why we're deleting the other part of that because we just want to be thrown in that direction and I also wanted to be just emitting from one point so like one strip like that so I'm just scaling along the y-axis so that's s and then Y that's just creating a thin strip like that and I'm going to go ahead and then scale that down to be something really small yeah about that so that is now our emitter very very easy so the next thing I'm going to do is create a particle system for that emitter so just go into the particle system over here what I'm going to do is uh yeah add a new particle system and I'm going to set the number of particles to be 25,000 so I guess quite a lot more than the default settings and I only want my animation to be a hundred frames long so just set that there and I want the lifetime of the sparks so each one of these little sparks to be no longer than 15 frames so that is less than a second so it's pretty short but that's yeah roughly about the birth rate of them I guess the weird term I'm also going to turn up the random amount to be about 0.9 so that means that the maximum lifetime is 15 frames but it could die at pretty much any point within that so setting that there because you know how well I guess if you watch footage of sparks there some of them die early some of them you know linger on for a little bit too long so anyway setting that random will that will fix that for us next I want to set the random right there so it actually emits from random faces not jetted and then the next thing I want to set the oh I suppose I should set the the end size of my animation to be just a hundred frames and I'm going to set the normal amount here to be ten so it's now spraying out like crazy by the way you can see those lines there and now the reason you can see those lines is because if you have a look at our cylinder right here you've got those that jagged edge there where the vertices are so the way to get rid of that those lines are if you add a subsurf modifier and then place it on top of the particle system if we now replay that you can see that those lines are a lot less noticeable and then if you want to take it even further which we are going to do I'm going to turn this random amount up to be five so that means that they're now going to be spraying in a lot of different directions so it's now it doesn't have that horrible looking streak effect there so that fixes that now we want there to be a floor so I'm going to go ahead and add in a plane and I'm going to make that to be roughly the size of that grid right there and I'm also because we want this floor to interact with the particles going up here to the physics panel and with the plane selected I'm going to turn on collision and I'm going to turn up the dampening now the dampening is basically when a particle hits it how bouncy do you want those particles to bounce off it so if you set that all the way up to one that means that the particles will not bounce they would just hit it and stop exactly so I'm going to set this to be about 0.6 0.7 yeah and I'll give it a random amount of point one so some of them will be slightly more bouncy than others but about that amount so they have a little bit of bounce but they mostly die and then the friction I'm going to set that to be 0.8 and then again I'll give it a little bit of a random as well and now one important thing to note is that with anything if you have any object with collision that is supposed to be interacting with your particles they need to be on the same layer as ours are right now if they're not on the same layer then they will not interact and blender will give you no clues as to why that is so just make a note of that make sure it's always on the same layer so you can see now I've got a couple gone through there was nothing validating that's the yeah that's the case problem every 10 frames it's doing cache but anyway the particles are now stopping on the actual surface where it should right there so that is now looking quite good indeed now you can see that it's kind of throwing those sparks a little bit too far back so if you want you can go ahead and delete a couple more of these vertices and that will mean that the particles are now thrown mostly forward so like that original wow that's almost exactly degree isn't it it's yeah yeah you know I'll eat free so let's just dinner there we go now you got some sparks going oh yeah about that direction it's pretty good okay cool all right so sparks done done and dusted they're now working pretty good so now we need to do is actually make it so they are renderable because if you would have rendered this right now you wouldn't see anything at least I don't think you will let's let's go again and give it a try yeah you don't see anything because these particles just exist in the blender world they don't exist in the render world I guess that's the best way to put it so what we need to do is we need to create a separate object the blender can use to render on each one of these particles so that is going to be I guess what is called the due plea so for that we need to use a very very low poly sphere or eco sphere so I'm going to use an eco sphere which gives you is a few less particles and a few less faces than the UV sphere actually I'm not going to scale that down I'm just going to keep this size as it is but I'm just going to drop it just beneath the plane right that so it's out of view of the camera so you can see in the bottom left hand corner there or in the tool bar on the left hand side name is ecosphere so with our particle system here selected if we go to the particle settings down here where it's got render you can see that it's set to halo which is like a method the internal renderer used to render particles halo does actually work in cycles so it wouldn't render anything anyway we're going to change that to object and then here where it's got due plea object-- I'm going to select eco sphere so now each one of those particles is displaying as an eco sphere but it's much too big much much much too big I'm going to turn down the size of that to be a point point zero one but it's still too big as well so I'm going to you know a little bit bit closer it's go point zero make sure it hang on I said three yeah okay my number pad wasn't turned on okay ah yeah I go point zero three I think that's pretty good size because you have to keep in mind we're going to be using the motion blur as well so some of these will have a little bit more thickness to them once you add the motion looks it'll take a little bit more screen space and I'm also going to turn up the random scale as well I'm going to turn that out to be 0.9 I'm stopping it from going point like all the way to 1 because then you'll have some way to like actually almost non-existent but if you keep at least point 9 then you'll have it'll be like a minimum size of you know whatever that one was right there I guess um yeah okay so you can see they're not looking pretty good now if we were to render this right now we should see a very very unsparing you can see just if you zoom in there you can just see it that's because it doesn't have any material yet everything is at the exact same material and there's not actually any light either so to make it even worse I'm gonna kill any light source that there is I'm going to make the background completely black and I'm going to move the camera to front view so if I look at it from front view if I hit ctrl alt number pad 0 just snap the camera to the front view there it's a little shortcut alright looking pretty good now if we want to apply a material to ask box as we do then we don't actually apply it to this thing right here this emitter because uh that's actually not even going to be rendered in fact yeah underneath the render settings in particle uncheck emitter because you don't want to see that we actually just need to apply the materials all to this ICO sphere right here because that is what blender is you to render it so go to the material settings and go ahead and add a new material now I'm going to go and split up my window here because we're going to doing some fancy stuff with the node editor so it's important we have access to that so have a guess what type of material we need for sparks okay so sparks are bright aren't they they're very light and even in a dark room you will see a spark so therefore it is an emitter but a light source in and of itself that's a cool thing web cycles is each little tiny object can emit its own light you don't have to fake things by adding in lamps and all sorts of random stuff cycles does it all for you it's very very I guess accurate to the real world so it's very cool in that regard so if we give this a render now we should now see our particles rendering I guess these samples for it is far too low let me turn up my samples let's go 500 I'll set it to sir to GPU just give this a render all right there we go get a bit better but you get the point so the particles are now showing up but they're completely white and they're very very dim as well so let's set the strength of those particles to be 30 so there now a lot brighter so they're now lighting up the rest of our scene a little bit better as well so 30 I find is about right I think what's it like if it Peaks I think it peaks at about 20 like that's when blend will be able to tell the difference in colors if you set it to 30 then it's kind of like it's blowing out the camera which kind of gives it a little bit more realism as well anyway in my experience so it's pretty uninspiring looking render at the moment so now we're going to be doing the fancy thing which is using a particle info node where is that particle info so hit shift a input particle info go ahead and drop this bad boy in now this is a very very cool new feature of blender which I love before we had this there was no way to do what we're about to do so what this particle info node will let us do is to change the materials of the particles in regards to where they are in the animation so you can see that you've got here you've got age lifetime location size velocity a whole bunch of different things like that so we can then use that to change the color we can make it face we can do all sorts of fancy cool things with it and that actually this particle info node is what inspired this tutorial and the animation that you saw at the start was because I heard about the particle info node and I was like yes I've been wanting this feature for years like I've been trying to create sparks and little expose and stuff like that and the annoying thing is is when you use particle system for it is you would you know you could set the material how you want but then always whenever the particles would reach their death they would just disappear like instantly they would go from completely bright to just vanishing and it completely destroyed any believability of the animation because you know sparks for example they fade out they don't just die they just they slowly fade out that's the way they are that's how fireworks behave it's how a whole bunch of different things behave so it's really really it's a crucial feature planer this particle info node it has been needed for years so I'm really really really super glad that it's finally here and that I can show you how to use it okay let's get cracking so what we need to do is we need to add in a math node if we wondering why do we need a math node well it gets a little bit fancy what we wanted to is want to take the output of the age and the output of the lifetime and plug it into that math node and then want to change the operation to be divided so what this is essentially doing is it's taking the age of the particle and then dividing it by the lifetime so the lifetime our particle system is 15 frames so the age of it is like per frame how long has that frame has that individual particle been alive for so it's sort of calculating if so if it's like here it's going to be like in whatever one and then slowly as it goes over because it's doing that division calculation that value will be less and less so what that means in this regard is we can take the output of this and then use it to change the material of things very very cool so for example let's have a look at how this looks when we do something cool so you can see that the color of our particles are defined by this value right here but you can see there is an input you can put something in there now you don't to just connect that there because that's not going to do anything that's not going to render it there's no color there's nothing there so what you want to do is add in a color ramp drop this in right here take the output plug it in there take the color output plug it in there and now what this will do is the left-hand side that will be the color of the particle at birth and the right-hand side that will be the color of the particle as of its death so the death of a particle of the a spark is an orange II red color so let's set that let's go I find it looks good if you kind of exaggerate it a bit if we just go fully red like that and then for the birth of the particle it's a white yellowy hot color so somewhere about that because having the emission set to 30 that's going to give it a little bit of a blown-out look as well so you can add a little bit more color in there so something about that should look fine so we're going to do now is give that a render and let's see if our operation has worked correctly I can see already that it kind of is and I can also see that I've got way too many tiles if you had a look at the post that I made last week I showed you that the performance it's best operated at 256 by 256 for GPU so I'm just going to change that so we got too many tiles has taken too long anyway let's have a look you can see on the right here where it's the particles are being born they are born as a white-hot color and then as they trail off towards the end there they become an orangey red color now you can see that you've got some particles that are over here which are like a white-hot color right well the reason for that is a few things and that's mainly because not all the particles are following the exact same route some of them have a random amount to us if someone were traveling faster than others and also we have a random lifetime size so some of the particles in here like this one here is like almost a solid red color so that one's just about to die and then these ones over here some of these are like white because they you know they've got different random amounts so that one's about to die they're like quite early on it was short lived at a very beautiful life but it died just right there and then at the end these ones just going to carry on for a little bit further so they do have differing values but you can see generally especially if you just look at the ground like if I just zoom in on this part right here you see they're white yellow on that side and then the ground as it trails off it becomes an orange color so that gives you an idea and basically it tells us that it is working hurray okay cool but we want it to be a little bit better than that because we don't want the particles there's currently the way it would go is the particles would die and they'll just disappear remember I told you that looks very very unrealistic you want them to fade away so in order to do that we're going to use this divided value again but we're going to use it to to basically act as the the changing value between two different shaders okay let's probably make my sense I'll just show you so we're going to add in a transparent shader and then I'm going to add in a mix shader' make sure to mix shading on a mix node they're very different and I'm going to drop it in as you can see pictured right here pretty basic setup we do this a lot with glassy and a few shaders I'm going to take the output of our divide node or math node whatever you want to call it so it's pictured just like this and then now when we render that it should now the particles over here should be trailing off I see you know what I should have done yeah I'll give it a render with just this and then I'll show you like the the buffering died let's give that a render okay so I'm going to put hit J to save that into the buffer and then I'll just connect this as it was before like this okay and now I'll render it again and what this will do is it allow me if I hit J again we can switch back between the two renders and we'll be able to see the difference that it makes that's a little tip for you so you just hit J you've got the slots here slot one slot two is you can have up to eight different rendered images saved and if you hit J it's sort of toggles between the two okay so here we go if I hit J you can see the difference so the particles that are red especially you can see they slowly fade away in value but the particles that are white-hot you can see they don't change almost at all so that means it is now working whoo-hoo all right so that's it we've got it done it's done and dusted so the part the sparks the particles everything is ready to go everything's finished so the result doesn't look very impressive at all does it well it looks cool when you have depth of field so if you had the camera right here and we set the depth of field to be the cylinder which is our particle emitter right there that's what we're going to focus on and then we set the f-stop to be something low like 1 and then let's say I'll duplicate that camera and I'll just move this over here I'll rotate this around let's just take a look at this so this just gives you an idea of how I did the because a lot of people were asking in the comments of the oh I guess on Twitter or whatever how the depth of field was done like how it looked so lovely or whatever it's pretty basic that's all you do there's nothing fancy about it it's pretty a pretty uneventful you just set the f-stop to be 1 which is really low or even low off you want to go extreme like what I did say 0.2 and it'll probably take a lot of render now you can you get the picture it's just just a matter of just changing that value there I think I think I probably do like a quick tip tutorial next week and I'll show you a little bit more about that anyway that's how you can do that little depth of field effect at the back there but the other thing that I'm going to show you in this tutorial is using the motion blur so depending on whatever version of blender you may have if you have just 2.64 you won't have this yet so I think you need to download the latest build the latest trunk bill which you can get from the link which I'll provide for you and then you'll see this so you go to the render panel right here you click motion blur and then when you hit render you should be able to see blur but you can't can you no no so you want to think are this stupid feature it doesn't work and I think I think I see a few people like I saw it like submitted as a bug in the thing saying it that the motion blur doesn't work and actually does work but it only works in CPU mode so you can see that my device is currently set to render using my graphics card you need to change it to render using your CPU so that means that it is going to take a really super long time to render and that is why the animation that I created it doesn't have motion blur on it at all because it would just take far far far too long to rent so because currently at CPU so in the future I'm sure it's going to be enabled for GPU as well but currently CPU only so sorry guys if you're planning on making an animation anytime soon you might want to wait for it to be GPU enabled because then you'll actually be able to have a life I guess outside of blender anyway so that's it that's the that's the the streak effect right there I'm going to amp it up a little bit more I'm going to make this it's go point yeah let's go point seven-five give a little bit more and I'll turn up my samples set this to be 800 and I'll give it a render let's see how it looks and there you have it that's it final render so you can see very very quickly it's very easy now to create sparks with very realistic I guess physical properties they actually emit light and have got trails according to how fast they're moving and the you know the shutter speed and things like that so it's very very easy and quick method so I used it to create that animation at the start there and I didn't have motion blur and abled for the animation but I decided to render the scene with motion blur it took like an hour and a half per image so this image here it took like 90 minutes to render it's absolutely crazy but I also did a little bit of post-production um and I guess I'm kind of breaking some blender rules here but I'm using a plug-in called Magic Bullet Looks which I use to very it's just it you can do pretty much the same thing using the compositor but allows you to just very quickly change the look of of an image just yeah using some very easy stuff there and just experiment with it so I I just started using this because I just thought it was kind of cool and you know like I said you can have a bit of fun with this kind of stuff I know not everyone can afford it cuz like 300 bucks or something but you know I thought it was kind of cool so I just experimented with that and I yeah I had a bit of fun with it and that's how I got to the final result you can see right there so there you go guys that concludes this tutorial I'm hoping you can then use the methods for this very very simple easy way to create sparks using cycles and blender I'm hoping you can use that and a whole bond new projects have fun with it this this image that you can see here it was created using the exact same method I just showed you the region that looks cool it's bouncy stuff is because I physically modeled a circular saw with this guard and stuff like that so it bounces off stuff and it looks a lot cooler but that's that's basically it in a nutshell guys so I'm hoping you enjoyed this tutorial and until next time I will see you then
Info
Channel: Blender Guru
Views: 358,952
Rating: undefined out of 5
Keywords: blender, tutorial, sparks, cycles, particle info
Id: QCMyvcc3ZaU
Channel Id: undefined
Length: 23min 48sec (1428 seconds)
Published: Wed Nov 28 2012
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.