Unity 5 Tutorial: Particle Systems #04 - Sparkles



hey guys my name is dr. Mann and today I want to show you a new particle effect which is a sparkle so everyone knows it in big games and stuff there will be a lot of sparkles maybe as bullets or maybe as something to show or actually highlight in your scene and yeah I'm going to show you the effect we are going to produce a day so there we go this will be our sparkle effect yeah which will be in a sphere and or that little sparkle pulse will grow a bit and yeah rotate slightly into different directions this can be also be done or there can be more effects added to that small sparkle effect so that's what we are going to do so let's get started with that I'm going to delete our sparkles and create a fresh a new one so what I do first is again right-click and create a new particle system I'm going to reset the song the position to zero zero zero so I'm going to be in the center of my scene and what you need is one of those kind of textures my texture here is a 256 by 256 and you don't need any higher resolution in that particle effects or particle parts I made this one with a black background and then just you'd used to fall off to the outside so I have four spikes on that yeah on that alpha map why did I do that I had a question of the user Wow if I could do something with Photoshop and show how to create backgrounds or actually how I can export from Photoshop that files with transparent backgrounds well basically you don't need to have transparent backgrounds that's what why I do that so you use a black background and then just use grayscale colors from white to gray or dark gray and then produce your own particles you can also use other things like whatever you want so yeah let's get started this is what we need or what I need basically I need something where the center is yeah in the center of the picture everything else would produce some problems or actually nothing we could use with the shuriken particle system so let's get started at first school again as always go to text to type and change texture to sprite 2d this way we can yeah make sure everything works properly then we go into our materials and create a new material and I have mine here already I'm going to yeah I leave that alone for now I'm going to show you what's the difference between other particles which have a transparent background instead of a black background so we create that new material and call that one yeah press f2 to rename that again if that happens rename this one two stars on star one I don't know I was the one it doesn't matter for me right now so what I do I go and select this one so it's in the inspector and go to texture and drag this one into the albedo Channel what you can see right now is that the map is has still the black background so we need to change the shader of course to make sure that we get rid of the black background normally if I have a transparent background I use another shader which is normally the alpha blended shader but since this is a black one this one will produce or would produce some weird or strange yeah stuff in here so you can see this is not what we want so don't use alpha blended in the instead use additive or additive soft additive just to make sure that all their gray scales works working properly and also those or the dark the black stuff is gone if you use additive soft then it will be more grayscale and yeah way softer and of course yeah looks nicer so you make sure you which ever you want if you want more softness in the grayscale itself then just use the soft particles factor so if you reduce this one it will be later on the software ok so once we set up the part of the particle material we go and add this one to our particle system in my previous tutorials about particles I just did all that stuff on the particle system itself but you want to make sure that I know it's a bit late that information you want to make sure that you use that particle system systems on empty game objects so at first I select my particle system create empty and now then the game object is on the right position or basically on the position of the particle system then I drag this one outside and drag the particle system on the game object so now I can rename the game object something like FX Sparkle so everything when you use later on use spells or other things you can instead of going with a direct particle system you can just speak or actually use FX Sparkle so it can use and move and rotate and all the other things just on the empty game object and you won't ever ever go to the particle system itself and you can call this one whatever you want like arm ps4 particle system and then maybe sparkle sparkle one depends on how many sparkles you are going to add so let's get to the material part we I go to my materials folder I go and daddy to add one it's bit weird that it is not shown right in the preview but okay so I have my editors in here I have the softness to one basically for now and can change this one later on anyways go to the s and PS sparkles of particle system sparkle in the renderer and drag in the material now we are yeah getting all the sparkles or actually that small stars from the middle and just growing up what I want is I want them to stay on one position so at first I choose FX sparkles okay empty game object and drag it a bit higher and what I do now is at first I don't want any speed so I let the speed at zero now you can see all of them are in that cone base shape or created in that cone base shape this is not what you want so we go to the shape and instead of the cone we use a sphere and since the sphere is too big and they are still too much around I just reduce the radius to 0.01 so all of that sparkles will create it in the center of the object or in the center of the particle system the next thing is I want to make sure that I have a variation the variation in rotation first so I go selected small black arrow on the right side next to the rotation tab line and choose render between two constants and what I can do is I can set of start rotation of zero and 360 so all that sparkles will rotate in 0 and 360 and we already get that small sparkling effect but it's still not enough I mean it looks really nice the additive shader works really nice of course about it's still not what we want or basically what I want if you need something like that then you're just done with your particle system so what I want is I want to change the size the start size also between two constants the first constant might be a 1 and the second one maybe a 5 so I have a bit bigger sparkle at first but we or I will reduce over the lifetime and stuff right now so my knife time will be at 1.8 and the duration will be at maybe 2 so I get a bit more life into that sparkle but still it's really hard actually so what we add next one is we want to make sure that we have let's see color over lifetime what's color over lifetime we can choose the transparency in two directions or in as many directions as we want what does it mean is I can say if the lifetime is at 100% I go and reduce alpha to zero so all that sparkles will blend out once they reach their own lifetime the same thing can happen when I blend them in so when they get yeah gets to live so I drag that one to the location of 50% click on here and create another one and this one can also be an alpha of 0 so they will blend in will be full color and then blend out again so we get nice transitions between that sparkling stuff and they get blended in and blend it out if you need that part in the middle bigger and just produce or create another of them just next to it choose a full color of alpha and then increase the sparkling as you need them if you don't want any of that arrows in the middle just drag them up and they will disappear in the middle or basically in that yeah they will just disappear ok that's it for the transitions blending in blending out now I want some rotation so I go to the rotation of a lifetime cap once active all of them to 45 degrees sparkling that's not that again not what I want I go and use another random between two constants and what I want is a minus 10 and the plus 10 so they will go randomly with a 10 degree rotation to the left or to the right or anything between some faster some slower so this is yeah what I want the next thing is I want them to reduce or increase their size and so I go to the size of a lifetime tab activators and then here we have a curve so I choose one of that prefabs maybe this one so over time they will increase the size from 0 to 1 but that's too much I want just from the middle like 0.5 to 1 or maybe something in between so it won't be that much and yes that's it the last one is we can use some different colors on our sparkle so we can use a gradient or random between two colors again so what we want is what I go for is maybe some magenta and the second color will be white as you can see only the outer parts are our magenta and the middle is white this is the second color if I would do it different like this one white and the second one maybe red and the middle one should be or maybe I know it's just random again okay so this is I'm just happening how it is so again I choose this one to be blue and the reddish color will be just white I think it's because of the additive shader that the central is going to be white and if you only have one color then everything will be blue so again back to that and I think no matter which of their colors I'm going to use the additive will still try to add some whites into the center as used I'm yeah as it is doing so no matter if I use crayon stuff okay so that it that are basically how you can create Sparkle effects for maybe yeah some highlights and your scenes something you want the player to pick up or maybe some kind of bullet or anything else on projector which might be shot around so don't forget to zero the position and you to use everything else yeah just use the ethics Sparkle and drag this one out to make a prefab out of that so that's it pretty simple pretty quick maybe cone you can make some good use of this if you want to have not that hard yeah that had outlines which come from the texture just make sure that you have some second on some smooths up radiance to the outside to the left and to the right and then you will have a way smoother sparkle effect okay that's it if you like that video just yeah some bit up if you have any questions about sparkling effects or anything else on particle systems or whatever about unity feel free to ask me even if you have a request just write me a message or send me a command on whatever and if you don't have to subscribe to my channel already ya then now is the time to do it and to see more videos in the future so yeah see you on the next tutorial that's it funny for me and for now bye bye




Comments

Leave a Reply

Your email address will not be published. Required fields are marked *