Stylized explosion using visual shader

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] oh boy okay this is gonna be a long one um hopefully gonna stick around for until the end first of all i'm gonna tell you a little bit about the concept of this uh particular vfx so we're gonna create a stylized explosion and uh for me at least the way that i understand explosion it starts with like a hot thing and then it burned out and then it becomes smoke right so that's what we're going to do now in this case i'm going to make a shader that will control the how the particle behave or in this case it become started from hot burning things and then it's slowly burned out and then it becomes smokes in this case we're gonna use alpha to control that so this one as you might see this is when it be uh so hot and then you need to drive the emission strength into zero which turn it into smoke after it turns into smoke and you can just dissolve it so that's the concept of the vfx itself anyhow so let's just make this one it's gonna be a little bit complicated so yeah bear with me let's add a new scene in this case while still gonna open that up just in case i need some help create a new 3d scene and call this one maybe a particle it's a particle save it for a moment that's the explosion one that i already created maybe i just loaded explosion two and then save it over there particle and then let's create a new mesh mesh instance in this case and then create a mesh and then put new sphere mesh right there you go new sphere mesh and then we're gonna put on the material and then create new shader material click on the new shader material and then click on the new visual shader first thing that we are going to work on is the alpha mask where uh it's going to dissolve or dissolving effects so i'm gonna create a texture first texture uniform and then i'm gonna oops i'm gonna rename it into i don't know alpha mask maybe will work all right and you can connect it to alpha over here if nothing really happened yet oh yeah you need to connect the rgb into alpha node or alpha point over there so nothing happened yet because we haven't created any mask and just create new can you see that all right a new noise texture click on it and then noise create a new open simplex noise as you might see over there it becomes a little bit transparent and then we click on the seamless so there is no seam um go back to the visual shader click on that again but right now we are going to set the alpha or the mask here it's either going to be opaque or not right we can do that by rounding the value over here so by rounding the number or rounding the value of the noise texture is going to say like oh it's zero it's one there's no in between so that's what will happen to your material now now we need to create another variable which is a scalar uniform and call this one is alpha this is going to be the controller of how opaque is the object then we're going to multiply slide it over a little bit multiply the texture the noise texture or the alpha mask with the alpha by doing so we're gonna hold on a minute we're gonna all right let's go so we got a control we can control the alpha or how opaque it is as you might see it's a little bit weird because the alpha over here it's uh the maximum number or when it's fully opaque is 1.5 instead of one right we can do that by using uh by adding to the value over here so when the inspector says zero it's actually one uh 0.5 when it says one it's actually 1.5 right so now one it's opaque and zero is kind of not so with the alpha is working now so it start from zero and then going fully opaque on one but as you might see there is a back face cooling calling happening you can always change the mode and then set the call to disabled and it will also show the back of it but as you might see there are going to be some problem like on the edges on the edges over here you need to set the depth draw in two instead of opaque should go to alpha pre-pass so it becomes nice so we have a working alpha mask mask so hard to pronounce alpha mask now and now let's work on the uh starting thing when it popped up i don't know what to call that but yeah let's create another uh uniform which i don't know maybe just use uh color color uniform go here and then call it emission color all right all right you want to go fully and go ahead and mission color and then clamp it or not clamp it would you connect it to the point there what do you call that that's not a node maybe there's no there connecting the node connecting the dot so if you set the uh emission color to to a color it will uh add or actually it will add to the existing color so in this one the the default color is white like that but then yeah if you change it to red it will add to that color so let's go back to emission color and then we need to multiply but this one you need to use the vector operators because emission color is an operator as an operator is a vector 3 i mean and then go to the emission and then let's put a scalar uniform and call it emission strength mission strength and then just go there connect it there and then we can just adjust the emission strength so yeah if it is going to wind it yeah it's going to be actually you can just set it to like more than one which is also good but if you take if you set it to negative it will become like the opposite color of the emission color i think that's what's happening but yeah and then that's it actually that's pretty much it but maybe just add another uniform color uniform and then this is for the base color so i'm just gonna call it base color dude that's so small yeah you cannot see it but hey you know there you go it's connected to the albedo and then albedo what what do you how do you pronounce that albedo albedo dude i don't know my english little bed yeah maybe set it to like grayish color maybe a little bit dark grayish because it's going to be our smoke color right and then yeah i set it they're going to set the alpha to this but in the beginning it will become or it will shown the hot uh state state of the particle and then it will cool down and then become a smoke and then it dissolve so basically that's what we are going to do right i told you already and so we have worked on the emission and the alpha itself you know it will dissolve when you change the alpha and it will uh set the emission to zero if you set the emission strength there and then next i want to work on the displacement map or not the displacement the mesh in this case or distort the mesh i don't know what to call that in this case i have this animated uh displacement map over here it's done through vertex shader shading over here but yeah i'm going to show you anyway go back to the visual shader and then go set to vertex it was in fragment before and then you need to go to vertex and then we add another texture texture uniform and then call this one displacement wait why am i using that hold on a minute this placement texture all right well that's a lot but yeah let's go there nothing really happened yet why because once again we haven't created any uh texture there noise texture and then let's simplex noise nothing happened why because we need to assign a vertex first we need to put an input over here and then we add this uh vertex input into our noise texture so hold on a minute let me reconnect that and then there you go but as you might see it distort to one way which is to the right or to the left it depends on the rotation of the camera but we can do that we can fix this by uh changing or multiplying the texture with the normal of the mesh so in this case let me reconnect that and then add normal to the normal input to the shader and then there you go right now it deformed from center outward right and then we can also make uh or multiply which going to be the the strength of the displacement itself and then i'm going to set this place oops uh what am i looking for a scalar uniform maybe my typing skill is kind of bad scalar uniform and then call it like uh displace how much displacement do you want how many how much how many displacements how much displaced do you want it to be and i think that's the correct way of phrasing it now it doesn't really deform but when we go back to the material and then we set the displace to a higher value it will displace or it will distort the mesh itself uh you can also change or play around with the noise texture over here but as you might notice in this demo it's actually animated we can also do that you know it's not a hard thing to do we go back to the shader and then we create another texture in this case texture actually we don't need to create another texture we just put the input time over here and then add to this case and uh we add uv first also we add uv connect the uv to the add and then this one also there but we need to specify which direction do you want it to animate in this case i think i'm it's going down so it's uh positive on the y axis all right save the project don't forget and then connect it and connect it nothing happens yet because you need to specify the y value in this case i think i'm gonna go one so oh one is too fast all right 0.5 all right oh actually minus all right okay so minus 5 minus 0.5 will go i will make the distorted um mesh animated so yeah pretty good all right so we've done with the material of the particle itself so we need to work on the next uh thing which is the particle system so let's go to the create a new scene and then create a 3d scene and call this one part system or whatever you might call it you know actually and just do that because i love it and then particle system and then we add the particles to it and let's uh add new processing material or new particle materials and then uh yes that's it that's it for now but and then you go to the draw passes and then you need to create a new mesh new sphere mesh right now it shows something then uh you can just play around with the uh value over here but i think the things that really really important is the explosiveness you know i usually set it to one or maybe 0 19 0.95 it's all up to you and then uh where is it the value of your amount 32 and then the gravity i think i'm gonna set the zero first and then the emission shape set it to sphere and then it just showed up like that right after you have this uh particle system working for you or at least showing something now let's go to the material tab and then go to the explosion part material you know oh don't forget to save it first so in this case you need to click on it and then save the material and it will show the dialogues whatever and then you need to drag the explo flashing part material to the material section now it doesn't really animate the way that we want to because there is no driving value or driving variables that drives the variables you know what i'm talking about but yeah now let's go to the shader again it was in the vertex go back to the fragment because that's what we are going to deal with first i think i want to work on the alpha so the the masking itself so instead of using this alpha i think i'm going to use the uh built-in alpha input right so in this case just disconnect the alpha and then connect it to add nothing really happened yet why because you need to set the alpha on the particle of the processed material on the particle system so in this case go to color and then click on the color ramp can you see that okay i think i need to go up a little bit alright click on the color ramp and then new gradient texture click on it and then uh on the gradient create new gradient and then yeah it actually doesn't really matter the color but i think i'm gonna switch it to from instead of from black to white i'm gonna set it to from white to black right then you need to set the alpha also to go down and as you might see it's instantly animated the way that we want to right now go to the pass and then go back to the material and then go back to the visual shader that's a lot of stuff now i think we can just delete this color uniform there just for the clarity sakes and then instead of using the emission strength we need to use the alpha again because the alpha will drive the same value you can also drag it over here but i think it's just make it to a spaghetti confused confusing things so i don't really want to do that and then when you set the alpha to that it's actually looking pretty decent but as you might see it will fade out in the same time we want the emission to fade out faster than the or the faster than the alpha mask right so we need to what we need to do is subtract the alpha with like a value like 0.5 maybe but you might as you might see there is like it turns into green as as i point out before if it turns to green ish color it because it becomes negative and to limit that we can add max function let me drag it a little bit so can be a lot clearer oops max and then just connect it there and connect it there so it will not turn green anymore that's pretty much it well maybe to add a little bit more variation you can also assign the noise texture into or you can also assign a noise texture maybe oops all right it doesn't really feel so hot because the emission strength is not uh what is it it's not set maybe i need to put another scalar or put back the scalar uniform for the emission strength emission right and then multiply okay multiply multiply and then multiply why doesn't it connect all right connected again right let's go and the strength set it to [Music] how many how much right maybe 20. oh that's too bright that's all that's good it doesn't really show much because there is no lighting over here so i can just copy the lighting from this case or from that node to this node all right it doesn't look better but you can't work uh tweak things around you can also work on the particle movement itself so let's say you want it to move a little bit on the upper direction you can set the gravity to one and it will move maybe not one oh 10 is too much to three and then yeah okay also you can play around with the damping damping is just a force that stops the movement from happening if the initial velocity is two you can put it higher but if it is too high like 10 for example it will stop immediately unless that's what you want but i usually want something or something that still move or that still lingers a little bit the movement still lingers a little bit now for the finishing touch i just add the what is it sphere over here like in this case as you might see on the demo there's a sphere that popped up before the explosion happening so you can just pretty easy to do that create another mesh instance and then put on the the new sphere mesh click on it and then create a material just use a spatial material because it's built in so i want to turn off the particle first first and then click on the emission enabled and then set the color of the emission in this case i think i want to make it a bit reddish reddish and then set the albedo of the color of the base mesh or the mesh itself set it to yellowish or even white ish and then maybe play around with the energy here yeah two sounds good three that sounds good seems good yeah i'm gonna put animation uh player over here create new animation and then just call it explosion explode actually set it to one it's fine go the particle system and then set the emitting to yes click on the keyframe to add animation and then maybe go a bit forward like i don't want to turn on the snapping over here maybe like zero zero point five zero point zero five and then turn it off and then set the loop or will it loop let's see right okay that looks good and then we need to scale this things up you can actually scale it through the uh the radius over here like set it to two and four right or you can just use the uh where is it the transform here but yeah it works the same and now from visible to invisible that's what we are going to do visibility click on the keyframe there and maybe around 0.1 let's say 0.1 set it to invisible all right is that too too long linger too long i don't maybe it lingers too long probably it's not big enough maybe make it a little bit larger 2 and then 4.4 right right oh that's lingers too low yeah you can always play around with this one all right or maybe just make the size of the particle smaller maybe that will help it doesn't though it looks better i guess yeah you can also put more particle in it you know like 64 maybe it's a good number yeah i think in this case you just play around with the what is it with the value and try to find the look that you want all right oops why isn't it all right okay you can also play around with the color to to set how fast do you want it to fade out or to dissolve something like that it doesn't look good though maybe make it a little bit faster with that all right okay let me turn off everything the gizmos uh cpu whatever all right all right it still looks too what is it it's not that randomized so i think go to angle and set the angle to whatever value that you want and set oh yeah i forgot to rotate the y alright so it will go to the random value all right all right so that's one way of doing it all right so here is the example that i created inside a game in yeah a real game not a real game but it's just a prototype and let's see this is eckham slash but i think you can use this in different type of game of course vfx tend to be general so right the enemy spawn would let me get away from the walls over there right nothing really happened yeah if i slash the guy there you go you have the stylus explosion over there kind of fitting with the shading that i've used in this case like a tune shader type of thing and yes as you might notice maybe there's a difference between the example that did i show you in the tutorial and also this one where it doesn't start with a sphere it started with uh spiky what is spiky spheres i don't know what to call it anymore but yeah yeah i created in blender and then you can export it and then use the same material actually with the tutorial that i showed you and also you might see the the difference in details in terms of the particle and the movement maybe and also there's a spark at the beginning of the explosion where you have to add more details to it well it's pretty easy to achieve i think i don't really need to make a tutorial out of it but yeah hey thank you so much for watching and sticking around until the end uh it was really really a fun and enjoyable tutorial at least to me experimenting doing it you know and yeah hopefully you use it in your game and please let me know what you made with the technique that i showed you and don't forget to like and subscribe all that jazz and leave a comment down below and what type of tutorial you want to see or what type of content do you want me to make and once again my name is arvidan garasse and i'll see you next time and see you on the next tutorial what am i saying all right i'm gonna ask your voice act this thing right
Info
Channel: Littlestryker ID
Views: 697
Rating: undefined out of 5
Keywords: godot, godot vfx, godot animation, godot visual shader, tutorial, animation, stylized explosion, explosion vfx, visual shader, metal slug explosion, breath of the wild vfx
Id: E-i3sZSXNMU
Channel Id: undefined
Length: 23min 33sec (1413 seconds)
Published: Mon Sep 12 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.