Visual Effect Graph - Tutorial #01 - Bonfire (Beginner)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone my name is Tommy Shay I'm a visual effects artist at unity technology and today I will do a quick tutorial about visual effects graph and for this tutorial we're gonna create a bonfire effect first a quick introduction about each really fix graph so it's a new package that comes built in with HD render pipeline and if you want to make sure you have it installed you can check out the window window menu go to the package manager and make sure you have high definition RP installed so it's visible in project here and if you click advanced show dependencies you will see that you have visual effects graph seven-to-one installed another thing to note is for this tutorial I have installed a set of sample textures for visual effects graph so if you want to install them you can check out and the project select all package then select visual effect graph and under the samples category here click the import button so here it will prompt me to import again but I I will not do that so whenever you click this import sample button you can check out in your project view the samples visual effects graph 7 to 1 and visual effects crap additions so here you will find a set of shader sub graphs and what is interesting here we require some textures for explosions smoke and fire so without further ado we're gonna start making of very first asset the visual effects graph relies on graph assets in order to to run effect and every asset is just a template so if you want to create one visual effect you need to go to the project view you need to right click and in the project view and select create visual effects visual effect graph and for this effect we're gonna be naming it bonfire and now it's already created so if I want to put it in the scene I can just drag it in the scene and it's going to be placed here and now I can start editing this effect so in order to bring the visual effects graph window I can either double click the asset or select it in the project view and click the Open button or I can as well click the select to game object and next to the asset on plate click the edit button so here it did open the visual effects craft window and editing purpose I'm gonna dock it in this window so here is the graph view of the currently edited graph and just a quick overview about the UI so it's a graph you with many connected nodes at the top there is a toolbar with a compile button that will trigger just a recompile of the effect but there's also auto toggle next to the compile and this will perform to compile a compilation when whenever I add a node I connect something or for instance when I disable a block here on the other side of the toolbar there is the blackboard toggle that brings the blackboard property sheet of the of the effect and also the target name object now game object is a panel that enables attaching to one instance in the scene and for instance suppose the effect or just stop it or just you can perform some stepping in the simulation or just restart you have also control of our play rate or you are able to send events on play on stop and if you want to edit or preview any object in the scene you can either use this panel if you attach to some instance in the scene so by default you can detach from this particular instance in the scene by clicking the detach button so I won't be able to control it anymore but if I go back to the scene view in the Yaqui when I select my effect I have some play controls appearing in the scene view so it's the same window but it's per instance so I can or from these play controls even if I don't add the VFX wrap window open basically I will be able to post one instance and it controls a very specific instance because here if I can duplicate the effect and then pause a very specific instance so if I want to attach my editorial to this instance I can either go to the graphics graph and then attach again here and then I will be able to control it from the FX graph so here I will detach for this tutorial and I will remove the additional bonfire effect it's not necessary so here I will start by turning this default visual effect into a smoke so here the first thing I need is probably to explain what are over these nodes in the graph so first you can see that everything in the FX graph is a set of vertical succession of big nodes and every big node is what we call a context so a context is just responsible for some was some behavior in the effect first we have this bone context here that is responsible for issuing spawn autos so it will only compute number of new particles to be to be created so here we have a constant spawn right and then it will connect to an initialized particle and initialize particle is just responsible for the burst burst script of one particle so it will be executed once for every new born particle and in this effect basically we set a random velocity of particle so it's going to be set once and for all and it's gonna be setting as well random lifetime so it's gonna be stalled once and for all and basically as the values are computed they won't change across the life of the particle then the initialized particle is connected to an update particle context and update particle context will be running for every living particle throughout all their lives so basically until every particle died the the update will be will be raining and date will be performing the velocity integration and aging and raping of all the particles so the velocity integration is just applying the velocity every frame so the particle moves and edging and ripping is just updating the age and ensuring the age doesn't go above the expected lifetime of the particle and then at the end the update particle context connects who output particle quad and the output context is responsible for displaying a particle so for instance if I disconnect the link between update and output I will not render my by particles anymore but I can also connect to the update a new context let's say leaked sphere and here are my particles will be rendered not as bright anymore but instead as small it's fierce so I'm gonna remove it reconnect the output particle quad and whenever I collect the the outline of all these context changes and basically this outline tells tells me that or the the succession of this tree context compose a particle system and everything in this particle system will be linked together so it it is a visual hint to tell what is in the system and what is not so small info about the rendering of my particles so here I display a default texture that is set in the main texture here it's rendered as a blend mode alpha blend and it also is configured using a camera plane facing with set size of a life so it grows as it added as it gets older and there's also set color over life gradient that fades in at the beginning of life and fades out at the end of its life so all these pictures here at what we call blocks basically blocks is just a building block of defining a behavior and these blocks are just a set of nodes that we can stack into a context and every note and every block will be responsible for unlink one task and let's say for instance I want to animate the angle of the particles route its life I can add a new block by right-clicking and selecting create block or just pressing the space bar after putting my my cursor at the desired location so here I will set for instance set angle over life and I will change to Z angle of my particle so it will rotate around it's normal and here I can set a curve so for this curve I will create to come between 0 and 360 degrees and now I have my particles rotating so what's interesting is I can reorder these blocks so they basically the order of the blocks is important not in this particular example here but sometimes you want to perform actions in a particular order because you want to get the result of one action and then reuse it for a later block so all the blocks are executed from top to bottom and of course you can move blocks between the context so here it will do the same as putting it in the output and if I want to remove a block I can press the delete button and if I want to disable block I can tick off its checkbox so here it's not executed anymore and it's permanently disabled so here I will remove it and now we're gonna put some smoke on every of this quad so we will change that will go to the main texture here and select a texture of a smoke let's say for instance a simple smoke so simple smokes is a texture that comes bundled with the FX graph and this texture is pretty simple but if I want to make a pink smoke I will probably have an issue of tiling this texture so first let's make a column of smoke instead of small puffs of smoke going randomly so first what we're gonna do is just change the initial velocity so it gets more straight and less recently randomly so here I will change the vertical velocity random velocity to throw in some two zero eight two one so it's more vertical and then I will change the x and z components to minus 1 minus 1 1 and here we are so we have a more consistent column of particles and I will probably want this column to be taller so instead of setting lifetime from 1 to random from 1 to 3 particle I will probably put it 4 7 5 to 7 so here if I reached up my effect by my by pressing function 5 it's just the same as restarting the effect I will have a gap in the emission and that's basically I have too many living particles so I cannot spawn new particles anymore and if I want to fix that I will either have to change the spawn rate or the capacity of my effect so here I have 16 particles but on the capacity of 32 particles so that means that I can emit 32 particles but I will have to wait for particles to die so here it's basically a imagine lifetime of 2 seconds because 16 times 2 equals 32 here I have imagined of six seconds so it would be 16 times six which means 96 particles and so here I have basically a correct amount of particles but still I have many small particles and what I probably want is less particles but bigger particles so tell what I will do here I will divide by four the amount of particles and I will also divide by four the capacity so it's still consistent and now let's just change the size of our life so all the particles render a bit bigger change it okay so here I have bit bigger particles but still the smoke is not animated and it also displays some repeating pattern that I don't like so what I will do first is probably change that texture to an animated flipbook and then we'll try to to improve on that so first we're gonna go to the main texture and change it to flipbook so for that purpose I have imported a wispy smoke flipbook so let's let's choose the wispy smoke 0 3b and then as I have selected this texture I see that it's so what I want but in the VFX right now it's not displaying correctly the free book because it's not configured as a free book and you know to change that I will have to to UV mode here and select flipbook blend and also I will have to set the flip book size here so it's by default it's four by four but here the free book was eight rows by eight columns so I will put eight by head here and so I have my flip book but it's not animating yet so what I will need is to add a flip book player block so it's going to be added in the update and here I will add the flip book player node and now I see that my smoke is piping correctly with animation what I will do next is change the size of the smoke and make it grow even bigger at the top ok we have a pink smoke but there's something I don't like about this smoke here is at first it looks like realistic because it's animated well but it's still animated too fast at the end of the chimney so what I will do is change the mode of the flip book player here for constant 25 frames per second to a curve over life and cover life will be will enable me to change the frame rate over life and the default curve here will tell me that I have 25 frames per second at the beginning of life and I end with only 2 frames per second so it's it's slowing down as it gets older and here it's it's looking way better when another thing is we can get rid of tiling artifacts as we had earlier so now it's less visible but there's a trick in order to remove this repeating artifacts throughout the life and it would be first to add some random rotation for the photo sprite and to do so I will go to the initialize because I want this rotation to be fixed at birth but not change a throughout the life so here I will go to the initialize and set angle so it's gonna be adding a set angle XYZ so we're gonna change the Z component and then we need this angle to be random so in order to change the value from constant to random I will select the set angle Z and change its mode in the inspector here from random from off to uniform and here I have two values so it's going to be a random between 0 and 360 degrees and now I have full random over my smoke there's also an issue butI smoke something that looks a bit odd is in the smoke there is some kind of inter texture there is some kind of precomputed lighting I will select it again and there is some kind of pre computed lighting here so it's not supposed to be termed because the lighting will go in will face in all directions and instead of using this pre computed lighting we are gonna perform our own lighting based on what you what we see on the scene so here I will first ring the ability to read from this RGB and only use the alpha channel of the texture in order to get rid of discolor we're gonna first convert the output particle quad that is currently and lead particles to a literal so if I want to convert this this context I will right-click and select convert output and then I will use a leaked quad output particle need quad so now I don't see anything because it's right now it's compiling the and here we are so here I have my particles visible as lead quad and what I'm gonna do is just remove this precomputed lighting from the texture so here I will select the context and in the inspector under use bus-based color map I will uncheck the color so only the Alpha channel is used and for the color we will use the particle color so right now it's combining again and here we are so we have the particle here and basically the lighting looks a bit odd because basically all these sprites are just Plains so all every sprite is just looking flat and what we can do is just change the two normals and if I want to change the normals there's one option that can help and it's named normal bending and whenever I enable this it's gonna bend the normals of the quad outwards so it's recompiling again and now I have my smoke and if I turn around now it not it's not flat anymore but it's a bit more rounded I will remove the base column up so you can see better here all the quads look more rounded previously it looked like that which was not rounded at all and basically there is this normal bending factor that enabled me to make the particle more and more rounded so we'll put back the wispy smoke and here we are so I have my my smoke that looks a bit more rounded there's still something a bit odd about the rendering so whenever I look behind my smoke I would expect to have some kind of transmission of the Sun through through the smoke but right now it's not the case because I need to change the lighting model from standard lighting model to translucent 18 model now with recompiles with the translucent lighting model and then what I will probably need here is to put some kind of diffusion profile because it looks green and it's the debug view for h0 and a pipeline that tells me that I am I don't have a proper diffusion profile set on my acid so here I will set a smoke diffusion profile twittery compiles again and here we are I have diffusion profile set for my particles so here it looks really really seen and if I want to control the thickness of my particle I can alter the new thickness slider here so it looks more thin or more thick and here we are so I have more thickness in my in my effect quick words about the diffusion profile so if you want to create yours you can right click create and under rendering a diffusion profile so it's gonna be a new different profile and if you want to use it for your effect you will need to reference it in the html5 line asset so in the HD render pipeline a set contains all the configuration of the rendering and here and on the material you will be able to set any profile you want so for instance here I will be able to set my new diffusion profile so let's go back at our smoke so something that will probably need here is to set change the color of the smoke because it it looks really really white and the smoke is never as white as this one so we will change the color in the gradient so I will alter only the first key and use some kind of grey grey grey smoke and that's it so I will I'll turn a bit more the gradient so here we are I have some some kind of smoke that reacts to the lighting and if I want to to see that in action I can also change the directional light so I can change the directional light so let's make a percent down sound on effect so here and just to be sure I will go to the normal bending factor on put it at its maximum so here whenever I turn around I see that my smoke is propelling it so now I will add some kind of fire to the to this effect so it's at the base of the fire at the base of the smoke I will create some flames to do so I will add another particle system to this craft and to add a new particle system I will right click create node and select system and in all the system templates here I will select a simple particle system so here I have a new particle system and it displays the very same effect as we add at first so what we're going to do here is change things a bit so first we need to change the texture tools on flame I will select a flame 0 3 this photo so we gonna require use the UV multiply blend and the texture is 16 columns by 4 rows to 16 by 4 also I will require a flipbook player and what I will probably need is stop these flames for frying around now I will remove the set furnace ta'rhonda and now I don't see any more flames because they are underground okay so here what I will probably need is to find some position to place these these flames so before that I will reconnect my target visual effects game object so I can edit it directly in the scene so I will select my effect click the edit button and it's gonna be connected again and now what I can do for this flame effect is some position a box block in the initialize so it's gonna be positioned based on the axis the line box and I will just change the size of this box so it fits more position of my particles okay something to note as well is the position a box is set to suffice I will put it to volume so it fills the volume yep so now I have really really small frames here the first thing I will probably need is to change the size so they much more the scale of my smoke so here I have a set size of a life so I'm going to change the size so it grows bigger and bigger but still here I have another story shoes is first my flames are absolutely not square are not consistent with their ratio at all for instance if I select my flame it's supposed to be way taller than Dan waiter so what I will do here is just change the the non-uniform scale of a flame and to do so I cannot alter the size because the size is a uniform and instead I'm gonna set the scale of every of every quad kala and if I want to make my particles less wide I will change the X the X channel and I will put it to 0 25 proclo probably 0-5 so so here I have my flames that have a consistent ratio now but still you see the origin is not staying at its own position and basically it's because in every cell of the flame the region is at the bottom of the of the card and here by default the particle grows from its center so what I will need is to change the pivot of every particle so it's not in the center but it's at the bottom and to do so I will set I will set the pilot and basically the pipe a vertical pilot is the y-axis so here I'm going to change the y-axis so here I can change it and what I will need is to change it to some negative values because it goes between minus 0.5 and 0.5 so here I put it 2-0 4 and now I have some consistent flames popping from from the ground there's also something that is a bit buggin because there's there seems to be way too much fire so what I will probably need is to reduce the amount of particles I will divide this value by four soon it's gonna be only four flames at a given time and I will divide the value as well there's also something when I select an initialized context I can if I'm attached to the to the effect I can edit the bounding box of the system as well so here is the numeric values of the bounds but I can change it so it fits more this one component okay and I can do the same for the photo I think smoke so right now it would not be rendered correctly because for instance if I go the bounding box goes outside the viewport it would it would go so instead of that one cannot change the bounds for the smoke and here we are so I visited the bounds I have some fire at the base and what I will probably need is to get rid of this pretty ugly cutting effect between the fire and the ground so here this can be solved easily by using some soft particles so in the final output quad I will use soft particle so it blends more but here we we are using a bit more it's a really wide factor so I will change the distance from 1 meter to something more tight say 20 centimeters seems good and what I will probably need here is to add some kind of blooming effect of the flames and to do so I will just change the HDI values of every flame so here for the first frame I will use the HDR multiplier at the bottom and I will not make it bloomed white instead I will tint this and at the end I will not fade to white but instead fate 2 right here we are the last thing we need probably for this book is to add some kind of lighting so here I will add as a child of the bonfire point light here and to set the correct values for this point light I will first change its range to 3 meters so it's gonna be only around the fire I will change the color as well so it's gonna be probably more orange and what is missing right now is just some kind of correct intensity this one so here I will change the intensity instead of using elements I will use Alex at a given position at a given distance so here it's gonna be how many looks I want at a given distance so here are 47 looks at one meter but I will probably require way more say 4000 looks at 3 meters and I'm gonna change as you as well looks more like the fire something that is a bit weird is I have a really odd ball of light here so instead of using a really punctual light I will change the radius of the sauce from 2 centimeters to 15 centimeters okay so here I have my my smoke that is lit that's just a bit more intensity okay and final things about this smoke I can try to regain a bit of detail in the smoke normals as well and if I want to do that I can add to the smoke some kind of normal map so here if I want to add some normal map I will select the smoke lit quad and choose use normal map and the inspector and then I will change the normal map here and I will set wispy smoke 0 3b normals and here we are I have regained a lot of of detail so just something to note about these normals there is some kind of normal bending already applied in this normal map so I don't need as much normal bending as I did before so I can turn down the normal bending factor and instead increase it the normals here because all the normal scale and normal bending rattle factor adds up this effect so here we are final things about the smoke I can add some some for sweet so it's not a pink straight so if I want to do that I will add a false and false is basically a physical force and for for some smoke and wind we don't need an absolute force that will make the smoke accelerate and indefinitely instead we will probably need a relative force that is treated as wind and basically a relative force is just wind velocity for instance 0.3 m/s and a drag force basically the drag force is the resistance to to the medium so here for the drag force I will use 0 25 and now my smoke is in everything the wind a bit more as it leaves so I can change the window wind speed as well so we put 2:05 and the small finishing touch about these flames they seem really really slow in comparison to the to the smoke animation so here I will change the P book player from 25 frames per second to say 250 frames per second and here we are so we have a very first fire and smoke effect mmm benefit last thing that is big bugging me it's probably the smoke is way too big at the at the beginning so I'm gonna change its size of the life here yes and here it is I thank you for listening
Info
Channel: Thomas Iché
Views: 30,666
Rating: undefined out of 5
Keywords:
Id: sNJ_SU20-o0
Channel Id: undefined
Length: 46min 17sec (2777 seconds)
Published: Thu May 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.