FIRE AND SMOKE with Unity VFX Graph!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

recently, brackeys videos have been more of a "hey this an official ad / showcase for upcoming unity features" .... too often i've started one and then realized it is using a system that is not implemented in base version of unity.... :(

πŸ‘οΈŽ︎ 7 πŸ‘€οΈŽ︎ u/ididnotseethat89 πŸ“…οΈŽ︎ Jan 28 2019 πŸ—«︎ replies

Haven’t played with it myself but it looks more intuitive than I thought it was.

I wonder how easy it is to apply forces to specific areas. Like a car passing through some smoke.

πŸ‘οΈŽ︎ 3 πŸ‘€οΈŽ︎ u/phero_constructs πŸ“…οΈŽ︎ Jan 28 2019 πŸ—«︎ replies

If anybody's wondering about how to create a smoke flipbook, then it's possible to create it in Blender with the Quick Smoke effect, but getting normal maps out of it is slightly more involved than what you expect.

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/Aerroon πŸ“…οΈŽ︎ Jan 28 2019 πŸ—«︎ replies
Captions
remember guys you should never play with fire except for in unity of course in this video we'll create a fire and smoke effect using visual effect graph at the end you should have something that looks like this and the great thing about doing everything in VFX graph is that it's extremely easy to customize to fit the look of your game and also your vault getting burns also special thanks to friends who are upper and your cannon go alright armand john shannon alexander player and infinity PPR for their support on patreon also this video is sponsored by unity and with that let's make fire so as you can see I've created a fresh unity project now whenever we want to work with visual effect graph we want to make sure that we're using unity 2000 18.3 or later that our project is set up with HDR P and that we have the visual effect package installed in the package manager if you want help setting all this stuff up I recommend you watch our previous video on getting started with ratio effect graph let's of course a link for that in the description now at this point we are ready to start creating some particles I'm gonna go ahead and disable the example assets here and instead I'm gonna go to the project and hit create go into visual effects and select visual effect graph let's call it smoke effect we now see a preview of the effect down here to show it in our scene we can simply drag it into the hierarchy awesome now to edit the effect we can simply double click it in the project panel and it's going to open up in a separate window we can take this window and dark it anywhere we'd like right now I'm just gonna put it next to our scene view here so right now all we see here is the default system which is not very exciting so let's go ahead and configure some of the settings here at the top here we have this spawn rate we should be able to leave this at 10 that should be fine for smoke I do however want to increase the capacity a bit so that we can have more particles at the same time I'm gonna set it to 64 then for the random velocity here I'm just gonna go ahead and change the minimum Y to 0.8 I'm also going to adjust the random lifetime to go between 5 and 9 this way our particles will live for longer which is typical for an effect like smoke where you want it to kind of flow around in the air before disappearing right now you can also see that all of our particles are pointing in the same direction I think it would be a good idea to randomize this route to give our effect Morphin organic feel so I'm gonna go to the initialized module and hit space to bring up the context aware menu and we want to set the angle of these particles I'm gonna search for a set angle and choose the first one let's also make some space for this so I'm just gonna drag down the other context here for the channel I'm gonna select D so now we can adjust the Z angle by simply changing this parameter right here and you can see for newly instantiated particles they are now rotated by 67 degrees but of course I don't want to define this value I want it to be random so let's go ahead and select this block and now in the inspector we can choose the randomness which is currently set to OFF let's instead set this to per component and we've now changed this block so that we can choose between a minimum and a maximum value so I'm gonna set it between 0 and 360 and you'll now see that each individual particle has a random rotation awesome next up we can go down to the output and the first thing that we can do here is actually just get rid of it because this is currently just a quad output which means that our particles won't be affected by lighting let's hit delete on this and instead let's drag the update down to a not the output which is going to be a lit quad output and as the name suggests this is going to be affected by lighting so let's drag that up here and first of all we want this to use soft particles we also want to set the smoothness to zero and it's now time to define a smoke texture however kony we're just using a single image for each one of our particles which is just the default particle sprite however one thing that would make our smoke look much better is if we don't use just a static image but instead used a bunch of images and combine them to create animation this is what we call texture sheet animation you might have seen it used for characters and it's basically just where you pack a bunch of images into one big texture then show one image at a time quickly after each other to create the animation so the texture that I'm gonna use here is called wispy smoke and if I just bring it up here we can see that it's just a collection of images in fact this texture sheet here has 8 by 8 images if you want to download this and use it as well now of course have a link to it in the description now what we can do is we can tell visual effect that this is a texture sheet and that it split up into an 8x8 grid and the effects graph is then going to take care of everything for us so to do this will change the UV mode from simple to flipbook blend we're gonna see that we get a flipbook size this is going to be 8 on the X and 8 on the Y and for our base color map we'll now simply drag in the wispy smoke now the particles are currently a bit too small to see so let's go ahead and add a multiply size node here and let's just set it to 2 so now it's a bit clearer and as we can see it's not quite working yet the particles aren't animating the reason for this is that we also need to go to the update context and here we need to add a flipbook player what this is going to do is that it's going to update each individual particle over time and we can set a frame rate for this animation here I'm just gonna set it to something like 8 and as you can see the particles now change over time which looks much much better we should probably also make the particles face in the direction of our camera because currently when we rotate around our system while things start to look pretty weird to do this we'll go to a lit chord output hit space and we'll add an oriental ock more specifically we want to orient towards our camera position so we'll select that and the particles will now look the same no matter where we view them from awesome however we definitely still need to play with the size of these particles more specifically it would be nice if we could make it so that the particles grow over time to do this we go to our output node hit space and search for size over life and let's choose the set size over live block let's also take this block and move it above or multiply size block and we now click on the size here to define our own custom curve I'm gonna select from the angled line down here and that already looks much better but I think that the particles are starting quite small so I'm gonna go ahead and increase that to something like 0.5 to give a more natural look and I think it's definitely starting to look like smoke now however one thing that would really help sell the effect is if we added some forces to our particles to do this that's go to update and let's first add a force block we'll set the mode to relative and the velocity to say- point you two point five and zero for the drag we can leave that at one and as you can see because of the drag which is basically air resistance or smoke is starting to clump together a lot more and because we've added this velocity over time it looks like our smoke is slowly being affected by it some kind of wind you can definitely add more randomness to this by using stuff like turbulence but for now I think it's pretty good we can also add even more drag to our particles by adding a separate linear drag block I'm gonna make room for this and the cool thing about this block is that we can set it to use the particles size which means that as our particles grow in size they will be more affected by a drag so we'll definitely want to set that to true and we can set the drag coefficient to something like point 1 now the final thing that we can adjust with our smoke particles and maybe also the most fun is how they're rendered so let's go to a lit called output here and click on it and now in the inspector we get a bunch of settings for this output context on the lighting we can for example set the material type to translucent now this is definitely going to be less performant but it means that we are allowing light to escape through our particles which is really typical for smoke and currently our particles are using both the color value and the Alpha of the texture that we supplied however if you want more control over the look of your particles in the effects graph we can actually set it to only use the alpha part of our based color map this means that right now our particles are completely white because we aren't supplying them with a color but we can then go in here and add blocks that do this for example if we want to change the color over life we can add a block to do that let's hit space let's search for a color over life and let's choose the set color over life block now by default this is going to have a really nice gradient that simply quickly fades the particles in and then slowly fades them out which definitely works for a smoke effect here now you could definitely go crazy with this and add all kinds of colors over the particles lifetime as you can see you can go pretty nuts with this or you could simply leave it white and then combine it with a multiply Colin arrowed which is going to allow us to adjust the color of the entire smoke with just one color parameter so we can make it red or for the case of standard smoke we can make it a dark brown in fact if you want to be able to reuse this particle system to create different kinds of effects around your game then we could create a parameter to control this that we can adjust inside of the inspector to do this let's just hit the plus sign here and let's create a color parameter let's right click and rename it let's just call it color we want to make sure to mark it as exposed let's drag it down here and connect it to our color input and now we can adjust the value from right here or we can go to the individual smoke effect and override it now the last thing that we can do to our particles here to really make them pop and give them more of a three-dimensional effect is to add a normal map to do this we want to select our output context and under used normal map we want to set that to true this will give us a texture input here for a normal map and I'm simply going to drag that in and right away we can see that our smoke looks way more 3-dimensional now let's add a point light to the bottom of our smoke effects let's right click on it go light and create a point light and this is both going to create the illusion that there is some fire at the bottom of our smoke and it's also going to create a really nice lighting effect up through our smoke we're gonna adjust the color of this I'm gonna tinned it a bit more orange now we can also increase the intensity to say 700 lumen that already looks much better if we can also go in and play with the gradient here I think currently it's getting a bit dark towards the end so I'm gonna simply take the color here and make it wider and the cool thing is that since we made our color a parameter we can then take the smoke effect and duplicate it and move it over and let's say that we want this one to be ordinary smoke but we want this one to be an emergency flare so we can go in here and make it kind of a light red for an emergency's flare look we'd also make it green for another kind of look and you can see just how easily we can change this effect to give it a different visual appearance if we make it completely white it looks like steam and if we make it really dark it looks like we're burning something that is not supposed to burn so from here sweetie up to you to use these same techniques to tweak the effect and add more detail you could for example create an extra system that also uses an image sequence to make flames at the bottom of the smoke you could create another system that makes flying sparks or Emperors in fact then we really quickly show you how to go about doing that so in the same smoke effect here we can actually a separate system so I'm gonna hit space let's create a swarm particle system and this is definitely not what we're going for so let's adjust this a bit we'll set the spawn rate to 10 the capacity to a hundred we still wanted to spawn in a sphere but let's set the radius of the sphere to 0.2 I'm just going to zoom in a bit so you can see it more clearly let's set the lifetime between 2 and 4 inside the update here we can remove the vector field force instead we can go over to the left here and copy the set velocity random from our other smoke system and simply paste that into a new system here I'm gonna make a bit of room and I'm gonna make it a bit widest let's make it go between minus 0.5 and 0.5 for both X and Z we know sir go ahead and copy both the force and the linear dragged into the update of our new system this way it's going to follow the overall direction of our smoke inside of our output here we can go ahead and create a multiply color node and if we click on this we can of course change the colors of our particles but we can also adjust their intensity if we increase this intensity we can see that we can make them glow which is really nice for stuff like embers here let's also set the size to 0.25 and finally we can add a tiny bit of turbulence to these particles to give them randomness to that we go to the update that's it space search for turbulence we want to change the mode to absolute this way the turbulence is going to ignore any kind of drag and right now all the particles have the same turbulence that's because we need to go under field transform and adjust the position of the turbulence noise and we'll adjust it over time so let's go ahead and add a time node we'll select total time and let's drag this on to our position so now over time we're going to change the position of the turbulence and you can see now that the particles are indeed changing direction over time and we can simply decrease the intensity on this so let's set it to something like point 4 and that's it we've now really really quickly by simply using a lot of the same techniques added flying embers to our smoke which definitely helps give it some nice detail yay that's pretty much it for this video if you enjoyed it makes us subscribe and also ring that notification bell so you don't miss the next one also definitely let me know if there are any other effects that you would like to learn how to make using visual effect graph and just letting you know that there won't be a video next week since we're taking a bit of vacation time at the office will of course be back and ready to make more videos the week after on that thanks watching and I will see you in the next video thanks of the awesome pitch and supporters who donated in December and special thanks to Francois Abba and you can echo our darman John Shannon Alexander player infinity PBR Sybok mommy sheriff Abdullah Chris Travis Dylan shares the prism era five banks along Luther said Clinton Vince Cuba Caston Sue Ellen Ronan mechanical mind the new Solomon Bruins cat Noah Kiyosaki Gregor appears Rob Baron Erasmus timber folder park and Chris Wilczewski for their support on patreon you guys Rock
Info
Channel: Brackeys
Views: 297,597
Rating: undefined out of 5
Keywords: brackeys, unity, unity3d, model, texture, models, textures, material, materials, beginner, how, to, howto, learn, course, tutorial, tutorials, fix, tip, game, development, develop, games, programming, coding, basic, basics, C#, VFX graph, VFX, graph, effect, smoke, fire, visual, swarm system, swarm, intermediate, explosion, particles, particle, gpu, image, sequence, flume, fx
Id: R6D1b7zZHHA
Channel Id: undefined
Length: 13min 56sec (836 seconds)
Published: Sun Jan 27 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.