Transcripts
1. Introduction: On these lessons,
let's see up to create an awesome meteor effect with its impact and
all of it in it. Hi, I'm Gabriel Aguiar, founder of Gabriel Aguiar
Broad YouTube Channel, where we teach visual
effects on games in Unity in real and in GoTo. And we also have one of the biggest libraries
of visual effects, assets ready to
be used in games. I'm also the founder
of Golden Bug Studios, where we are developing
Rabbits tail. Today, let's create this
awesome meteor from scratch with Unity VFX
Graph and Shader Graph. We're also going to use Blender and material
making for textures. We will show you how
to build everything. So without further ado,
let's get on with it.
2. Meteor, Impact Area and Trail: Let's begin by creating a visual effect graph,
right click Create. We can begin with
the minimal system and call it V effect
graph score meteor, underscore tutorial
or V two in our case. Once you open it up, we can go ahead and rename this graph. It's going to be for the meteor. We can say the bound
modes is manual, increase the size to
100 in X Y and Z, independent of the
camera position, we still see the
effect happening. And we want to begin
by emitting something. In this case, a constant
bound rate of one particle. That particle itself is
going to leave 5 seconds. We can already go
ahead and dragon drop the VFX Graph to the
scene so we can see what's happening and
reset transform. So it's at the
center of our scene. And now we are going to output a mesh for the meteor itself, and we are going to select
the output Shader Graph, so we can use a
Shader with our mesh. We can take care of a few
things like the size, for example. Let's say it's one. Here we go. Now we can
see we have a cube. This cube will not
work as our meteor. So we need to build a
mesh to model a mesh, and we are going to use Blender. It's very easy to pick up and we will try our
best to guide you, and you can delete everything
and only leave the cube. And with the cube
select, we want to add a modifier called subdivision, which is going to increase
the polycot of our cube. As you can see, now
it's kind of a sphere. So if you are worried about
polycunt, be careful. Need another modifier
called displace, and this modifier needs
a texture to work. So you can press
this new button, and it will create a texture, and that new texture
is completely back. We can access it down here. If you click here, here we go. And what to say
the type is noise. And as soon as we do it,
the displaced modifier, use this texture to displace
the vertice accordingly, creating this very spiky ball, which is pretty cool, but
it's a little bit too much. Maybe you can decrease
the strength right here to around zero at four, zero t six, with a
mid level of 0.3. And then we can
use shade smooth. You can go up there in
object if you don't find it with Space and then we can apply the modifiers from the top to the
bottom on this arrow. Let's rename this to meteor 01. And in file, we can go
ahead and export as an FBX. Make sure you have selected
objects turned on, and you can export this
directly to your project. Now, back in Unity,
we can replace that cube with our
newly made meteor mesh. Here we go. Let's make sure the scale factor
of the meter mesh, we import this 100 and then
press Apply by the way, or you can increase the set
size to 100 but either way, what we need now is to
improve its aspect. It's looking weird. So
let's create a new shader. We are going to create
a final shader, a very basic material. Can double click to open it up, and what we need to do is
turn off cast shadows. We don't need these
to cast shadows for now and enable
support VFX Graph. That's very important. So
it works with VFX Graph. And in here, let's search for a frenal effect node.
This one right here. We want to color it, so let's
create a color property that we can set the mode to HDR so we can control
the intensity, and the default color is white. We can dragon drop it
and multiply these two together so we can
tint the fnol effect. Connect this to the base color, and from here, we
have this power property that we can control. As you can see,
it's very useful. So let's create a float for a frenol power with a
default value of four. Drag and drop it,
connect it right here, and that's it for our Shader. It's very straightforward,
as you can see, and it's going to do wonders. If we go back to VFX Graph, don't forget to save the Shader, by the way, Fernl shaders. As soon as we do, it's
black in the center, but very white around the edges. We already have a default color
that we like to use here, but feel free to try a
different color, obviously. It's going to be a bright
orange. Here we go. And that's beautiful. Great. That's one
of the first steps. Now, what we need is to say that this is a meteor that
comes from the sky. Can do it via script, obviously. But for VFX learning purpose, let's do it inside VFX Graph, the motion, the velocity,
the collision detection. So let's use a set position
in initialized particle, and from here, we can
control a vector tree. It's going to be
our spun position. -40 in the X and 30
in Y, so it's way up. Dragon drop this to the
set position. Here we go. The meteor is up there
in the sky looking good. To make it move, we are going to use set velocity in
the update part, so it continuously moves, something like 40 on
the X and -30 on the Y, and it will land right here. Once again, if you are using
a script to move the meteor, you don't need this
set velocity as well. All right, looking good.
That's the motion we want. Now, let's work on detecting collision with a collision
shape set to plane. Where the lifetime loss
is going to be one. Basically, the meteor will immediately die as soon as
it collides, as you can see. And once it collides, we can spa a collision effect or
several collision effects. And to do so, we can
trigger event when it dies. Let's do exactly that so we
can spa a few more effects. Every right click, we
want to add a template, a minimal system for
our impact area system. In order for this to
detect the trigger, you need to use a GPU event. Let's already set the bounds
mode to manual, 100 in X, Y, and Z, so it's
visible even though the camera might be
outside of this area. And let's connect trigger
event to the GPU event. And we also want this impact area system to
have a lifetime of zero so the particles
immediately die and so we can trigger
another event on die. We are doing this because
there's a limit of eight events that can
be spun by system, and it is a workaround. You will see in a
moment, which means basically this system doesn't
need to render anything. We don't need the output. What we need is to make
sure that any particle that spouns from this system spouns
where the meteor collided. So let's make sure set
position is set to source. An update particle now, we can trigger
another event on die, one particle for the count. Scopy and pastes, we
are going to do this again now for particles. In this one, we are going
to spun 150 particles. Even if you use a
subsystem where we don't want to span
150 particles, we can limit the count
of that subsystem. Okay, now that we have
these two place holders, the impact area and
the particle system, we can begin spanning effects based on the
collision of the meteor. Let's copy the particle system and call it the impact beam. We can connect the
trigger event. Limit the part because it's spun with a capacity set to one. It will only spa one particle. To make it visible, we
need to output something. Let's use an output
particle and lit. This system doesn't need
to trigger anything. We can remove the
trigger event on die. It's going to have a
short lifetime of 02. We can already see a
tiny particle spawning, so let's increase it with a set size to around
15 here we go. Big flare, a big flash, a big impact beam. It's rotated sideways. Anytime you see anything
rotated sideways, you can use an orient block
so you can orient the output. In this case, it's going to
face the camera position. It's always going to
look at the camera. We can also enable
use soft particles, so we don't have an
art edge whenever it touches the ground or
any other tree object, and it can be additive. Let's give it a
color. We already have this predefined
color that we tested. Feel free to copy it or
test a different color. It's going to be super bright, by the way, a bright orange. We don't want it to
disappear out of nowhere, so let's use a set size of our life where it's big at the
start and then it shrinks. It's overwriting the set
size we have set previously, so let's make sure we set
it to multiply. Here we go. That's an impact, strong
impact, looking good. We can copy and paste this
system for the ImpactFlare, connect the GPU event. And the main difference
is the texto itself. We are going to create a
texto similar to this one, and this is the
kind of text we can easily create with
material maker. In case you don't have it,
go get it. It's awesome. It's a note based tool to
create textures and materials. And once you have opened it up, you want to begin
with a shape note. If you select it, you can preview it in the
preview to the window. Basically, we want a circle, a big one with an ard
edge, zero, and we go. We want to connect it
to a circle splatter. It's basically
going to replicate that circle several times, in this case, 50 on the count. The rings is the number of
rings for the circle pattern. We can set it to one
because on the scale X, if we set it to
zero.02, here we go. We can see all the
circles we are spawning. We can shrink them also onto
scale Y to zero at seven, and the radius of the
circles pattern can be zero. Incremental rotation,
set it to one. You can see all of the
circles we created. We can also say the
incremental scale is 02. It will grow slowly. What's important is that random rotation down here
is something like 30 and random scale
is 0.3, for example. Are all white, but with the
random value set to one, you won't notice that
some of them are dimmer and the other
ones are brighter. We want some gray scale
values on our texture, so it isn't fully white. This is an awesome node. The circles platter, as you
can see, super powerful. Now let's add the glow. We can use another
circle for that, but first, we need to blend it. So let's use a
blend node and then create another shape node
where we increase the feather, so it becomes smooth circle. And if you connect this
to the layer one of the blend and then
sec the blend node, you can see these two together. And here we go. We have a glow. Thing with this blend mode is that you can select
the blend mode. If it's multiply,
screen, overlay, let's set it to multiply, so it's a little bit
brighter at the center. And then we can
also blur this with a Gaussian blur with the
grid size of 2048 by 2048, maybe decrease the sigma, so it isn't that
strong of a blur. And if you connect
these to a colour ice, now we can control
the intensity of the white values,
as you can see. What's important is
that the black key, you set the Alpha to zero. So it's transparent. Maybe
it's a little bit too wide, but feel free to try it out, and then you can go up here on this button and select
export this texture, give it a name, select
the destination, and export as a PNG. And then you can
assign it right here. And basically, we
are going to use this for an impact
on the ground. So we can remove
the orient block, increase a little bit to size, remove the use soft particles. We are going to make it
parallel with the ground. So as a matter of
fact, let's use a set angle and rotate
it 90 on the X. Here we go. We are going to
see something on the ground. You can adjust the
brightness here. What's important is that
on the sides of life, it grows in the beginning
and then it shrinks. It grows fast, and then
it shrinks slowly, curve similar to this one. So you get this type of
effect, as you can see. It really looks
like an impact on the ground. Alright,
looking good. Now, let's add some
sparks to this. Let's move on to
the next system. We can copy and paste the impact beam and
rename it to sparks. So really impactful sparks. Connect the GPU event first. In here, we can increase
the capacity to 60, and the lifetime is going
to be random because there's going to be a bunch
of particles flying over. Between zero dot five
and one dot five, now there's a bunch of
particles in our preview. They are huge, so let's
make sure on set size, we say they are random uniform, between zero dot five
and one dot five. In this case, we don't want the set position to be
inherit from the source. We want the set
position to be crazy, so they move all around. So let's use instead
set position shape. In this case, a cone, we want them to spread all over. Let's just open this and say
the base radius is smaller, 03, but the top
radius is bigger, one dot five, as you can see, on the scene view,
we have a big con. We just need first to say the position of this cone is
going to be on the source. We can use a good position,
set it to source. Here we go. From here, we need movement, speed. There's this very andy module called set velocity
from direction. Let's first say it's random. The speed 5-15. Here we go. They go
sideways, as you can see. But if we say the
direction blend is zero, they go everywhere and they
follow the cone shape, which is exactly what we needed. Now, we just need to make sure they come down
eventually, right, because they are flying away
as if there is no gravity. Thankfully, we have
the update particle where we can say
they have gravity. The default gravity is that bad, but maybe we want
them to go a bit up. So minus eight will do
the rich just fine. Now, one thing we want to do
is stretch these particles. So the orient block is going
to be a long velocity. As you can see, if
you look closely, they are aligned with our velocity vector,
which is great. Let's take advantage
of that by saying the set scale on the X is
going to be zero dot two. And on the Y, they
are going to be two, and they look like
this, as you can see. Now, they are obviously
way too bright, but let's decrease
their intensity over lifetime with a
set color of life. We are going to use these
keys right here to fade them. It's bright in the beginning
and then they fade out. But as you can see, it's
overwriting the previous color. So let's make sure right here we set the composition to multiply. Here we go. This way,
they fade out at the end. We can also adjust the size of our life with a curve
similar to this one. So they are big just
for a tiny moment, and then they shrink
down immediately. Here we go. Looking good. Let's rename this
output to sparks just in case we need to reorder
all the outputs are rendered. And now let's copy this
entire system control C, control V for the
sparks sideways. We want some sparks to
be closer to the ground. They will be very impactful. For now, let's connect
only these new sparks. Let's also connect this
position source right here. We want these particles
to be really fast. 02, 1 second. They have a short lifetime, and we are going to
flatten this cone. So it's basically a circle
a top radius of 01. So let's increase their maximum
speed to 25 here we go. And instead of gravity, we want them to be
parallel to the ground. Let's use a linear
drag. Here we go. And when they hit the ground, they really expand those parts. Disable soft particles, so they don't blend with the
ground. Really nice. You can make them
a tiny bit bigger, maybe two on the maximum size. Looking good. Let's
see how everything is together and bio very impactful. Indeed, it's a meteor, so that's how it should be. Super impactful. Now let's
work on a few more elements. For example, the meteor
should leave a trail of smoke and fire
and even particles. So for that to happen, let's go back here to the meteor system and create a new trigger
event over time. So it keeps emitting particles, basically, since we
want to leave a trail. 100 for the rate
should be enough. Let's copy this
impact area system and call it the trail system. Connect this new trigger event and increase the
capacity to 100 as well. We want to make sure
the lifetime is random. Something between
zero dot eight and one dot five should be enough. In this case, we not need
position from source. We can use a set
position shape sphere, so it's bound in a
sphere like shape. But for the position itself, here we are going to use
the position of the source. Get position, set it to source. And connect right here, we want the shape, this sphere shape to
follow the meteor. Now, let's output something because we want to see
how this looks, right? So let's use an output particle and lead quad. Here we go. And it's leaving a
trail of particles. That's exactly what
we need right now. From here, we can
do a lot of stuff. We can indeed use
a SmokeFlipbook. So let's see how to
create a SmokeFlipbook with material maker. It's a quite powerful tool. For example, we can use let's search for FBM and use
this node right here, the three D text PM. If we select the
preview we have, and we can adjust
the scale to four. Cut it in half, but with
a lot more iterations, so it's a little bit more
detailed, like eight. From here, we can apply
this text basically. And we are essentially going to animate the eighth by using a math node where it's going to keep on adding time
this velocity. We can use the
dollar sign, time, multiply it by zero at one, and it will animate the
text, as you can see. You can make it
slower or faster. It's up to from here, we can begin to shape this, for example, with a circum, essentially by connecting
these directly to the edge map and increasing
the value to two dot seven, so it's smoother, and that's it. We could leave it as it
is. It would look good. We could connect to
a colorized node and clamp some values. But we can take this
a step further. If you connect this
to a power node, which is inside a math node, create this very opaque filling. And then with another math node, we could animate
this on the B value, a little bit faster this time, and then connect a line
from here to a text three D apply and connect the
result to the eighth math. What this will do is
distort the smoke, animate the smoke even further. And then all we need is to connect this to a
shape, one, one, multiply these two together with a math node and then
use the colorized node. You could directly jump
to the colorized node before using the power node, and it will look good as well. Let's begin clamping
some values. For example, dark values,
we could clamp them, and then we could
make the white values even more pronounced by
pushing this key to the left. Let's just make sure that blacky has an Alpha value of zero, so it's transparent and
that's it looking good. The way we export
this is up there on this button instead of
image is animation. And in here, we can
select the resolution. 1024 by 1034 is enough, and we can select
where it begins, the frame it begins
and where it ends. As a matter of fact,
it's the second, two, and 3 seconds. And then on many images we want to output,
in this case, 16, so it will be four by four
as a PNG. Here we go. We have each sprite
individually, and to put them together as a flipbook, we can use glue it. You can literally search
Google for glue it, and then download it's free. And once you open it up, you
can press the ad button, navigate to your smoke
images and add them all. Number of columns is four. You can press the glut
button. Here we go. Now, save it we can called SmokeFlipbook
and the score four by four. So you know the columns and the rows are simply
SmokeFlipbook 01. Feel free to decrease
the resolution. This is a huge
image, by the way. And then you can add it to the VFX Graph right
here, SmokeFlipbook. You can use a set size to
control how big it is. Let's make sure it's random. We want this to be 4-8. Here we go. We have an
entire flipbook showing up. Fortunately, in VFX Graph,
it's very easy to fix it. We can say the UV mode is a flip and we can even use
flipbook blend frames. It will blend
between each frame. You can also turn on
new soft particles in case it touches any geometry. It will be smoother, the edges, flipbook size is four by four. And to animate this, we
can use a set text index. And if you move it
around, as you can see, it switches between frames. So we need to animate it. It's very simple. We can
use a sample curve where the last key is going to be the value of how
many frames we have, but we start counting
out zero, so it's 15. And for the time, we use
the edge over lifetime, basically how long
the particle lives. And here we go. It's animated. Still needs a few adjustments. For example, we can make sure the angle is random
on the Z axis. 0-360, here we go. We can also play with color. Let's make sure it's
completely dark for now. And if you move the camera, as you can see,
it's not facing it, so let's use a orient block up here and make sure it
faces camera position. Otherwise, we see the quad
and it's kind of weird. As it is now, it always
has the same size. So let's use a set size of life. With a curve similar
to this one. It goes from small to big, but feel free to try
the up as it curve, but it goes from big
to small, for example. And yeah, we need
to make sure that the composition is multiply. Otherwise, it overwides
the previous values. We can also make sure
they fade over time. So let's use a set color of a life where the
composition is multiply. Let's open the graded and make sure that it
begins visible. Let's remove that key up there, and then it fades
to transparent. And here we go, we have a meteor that leaves a smoke
trail behind. Now, since we have
a smoke trail, it's very easy to
create a fire trail. So let's copy this
entire system. Control C control V, called the output smoke. And the other one
fire. Here we go. Let's connect the
trigger on update right here to the GPU
event, so it pounds. And for example, it's going
to leave less, right? The fire leaves a shorter
time compared to the smoke. Between 03 and Zoot seven
should do the trick. Let's also connect this get position source to our transform
position of the sphere. Oh, and let's remove
this trigger event on die both on the
smoke and on the fire. We don't actually need them. Push the outputs up here. Instead of being Alpha, we can make sure it's additive, so it's a little bit brighter. You could also try
it with Alpha. It gives a different tone. Let's go with the additive, and then to animate
the flipbook, we can use the same curve. Let's connect this right here. In terms of size, maybe it can be smaller,
like three and six. It can have random
rotation, yes, indeed. And as for the color, well, we have this color that
we already tested. It's 800, 250 on the X, Y, and Z. I think it's a
little bit too bright, but feel free to give it a try and we get this huge
fire left behind. It's a very strong meteor. You can leave the size
of life as it is. As for the color, you can
say the mode is uniform. We can fade it with a
curve, for example. It will look a tiny
bit different. And then the curve is going
to be this one big too small, and it fades nicely. You can control the fade
with the handles right here. It isn't as bright as
it was, as you can see. And if you put everything
together, here we go. This is what we have
very impactful meteor, beautiful one looking very good. So that's it for this lesson. On our next one, we
are going to focus on working on the crater
and all of its effects.
3. Crater and Finishing Touches: Right, so our next
step now is to work on the crater as if the meteor
pushed the ground around it. So we can copy this particle
system that we are using to trigger other systems and
call this one the crater. Connect the trigger event on di from the impact area
to the GPU event, and this crater
system is going to spun the crater and then
some debris later on. We are using this technique so we can work around the limit of triggers we can use per
VFX Graph, which is eight. So let's copy it again
for the crater elements, all the elements of the crater, and then connect the trigger to the GPU event. Here we go. And now basically, in this case, for this system and all of the outputs that we
are going to use here, we can set the capacity
to only one particle. They can leave 5 seconds. And from there, we
can output a URP let mesh so it can be
influenced by the lights. And for the mesh itself, we need a crater. If you already have one
laying around, that's great. We can show you how to
create one with Blender, just in case you want dressed. Basically, you want
an empty scene, and which shift we
want to begin with a cylinder of
around 16 vertices. If you enter mode, we can select the bottom
edge loop and push it up with the cursor or
with G value of one. And with S, we can scale this a value of
four, press Enter. Let's scale the top part of this, more or
less around here, value of two, and
then we want to push this top face
a little bit down. Now with control, we want
to add one edge loop right here so we can push it down and scale it down
a little bit too. Now with the top face selected, let's extrude this
with E and then press scape so it stays on the same position,
the new face, and we want to scale it down
with S more or less like this and then push it down
as well on the Z axis, and we have something very
similar to a crater already. Now, what else can we
do to improve this? First, we want to make sure that the origin is at the bottom. We can say origin to three
decursor so we can scale it up and down from that
point from that pivot. From there, we can
remove this bottom face. It's not necessary. And if you want to increase
the definition, the polycot, you can use a
subdivision surface, modifier, increase the levels. And if you want
to take this even further, you can use a displace. You can create a new texture. And then go down here so
we can edit that texture. And basically, we
want to say the type of this is a Voronoi. We can zoom in by saying
the scale is one, and if we go back
to the modifier, we can control much of this
display influences the mesh. Something like zero at
four should do just fine. Shade Smooth. You
can go up there as well in object to
use a shade smooth. That's essentially it. We
have very detailed crater. Obviously, this increases a lot to plyicon, so be careful. As for U V, you can
select everything with a while we are in edit mode
and use the unwrap conformal, which is going to be
fantastic for our case. It's going to wrap this as
a circle and it's perfect. Ali's left is renaming
this two crater 01. Then go to File
IEport as an FBX. You can export it
directly to your project, make sure selected object is on. And now, if we go back to Unity, we can add our crater to
our output right here. You probably need to set the scale fact to
100 of the mesh, by the way, I
forgot to show you. It doesn't need a
base color map. You can remove this text. Don't forget to set the
smoothness to zero, by the way. As for the size, let's try two. We could have applied
transforms on bladder, but let's rotate it right here. Set the angle of
-90 on X. Oh, yeah, it's transparent because
the blend mode is Alpha, but we can set it to Opaq
and with a set scale, we can control how tall
it is on the Z axis. So let's take advantage of
that and animate this value. Most of the time to
animate something, we can use a sample curve. In this case, it's going to
grow fast in the beginning. It's going to maintain that position and then
it's going to shrink. That's the idea with
this curve right here. It doesn't go above
025, for example. For the time, we can use
Git age over lifetime, basically the lifetime
of this particle, which is 5 seconds. Let's just decrease the
rate of the meteor to 0.15, just so it matches
here with our crater. Here we go. And then it shrinks. That's the general
idea right here. Yeah, on the update particles, we can remove this
trigger ventondi. We are not going to need it. Now, it's a small detail, but we can use set velocity
just to push it down a tiny bit on the Y axis before we shrink
it with the scale. We can even animate this value with a curve
similar to this one. And then use the ge of
our lifetime. Here we go. Let's put something else. Let's still use this part
up here and move it to the right and then push another
line for another output. But this time, output part
called Shader Graph mesh. We are going to make sure that the meteor is there
after impact. We can use the franel
shade that we've made and replace the
cube with the meteor. And say the set
size is something like 08, and here we go. It's right there at the
center of the crater. You can make it
smaller or bigger, or in this case, we can
actually animate the color. So it's really hot
at the beginning, and then it cools down. You can, for example, begin with this color at 485
and one dot five, and we can multiply this,
connect to the color. And since we are
multiplying this, we can animate the B option of the multi only this way
with a curve right here. We can say it's really
bright in the beginning and then it cools off like this. Once again, to animate this, we can use the edge
of our lifetime, basically, how long the particle
leaves, and here we go. It cools off, as you can see. That's pretty cool. Let's just make sure it shrinks
down as well. With a set scale, we can
actually reuse this curve, Control C control V
connected to the Y axis. But make sure these two
keys their value is at one. And then connect the edge
of our life. Here we go. This weight also shrinks down with the crater, it disappears. And lastly, we can
also make sure it's completely random every
time it hits the ground. Just like this. You can also
use this on the crater. You can duplicate models
by holding control and then dragging another output
or to another initialized, and it will duplicate
it. Here we go. Completely random the
crater and the meteor, the rotation on the Y axis. Another thing we can take
care is make sure that the crater is brighter
at the center. So basically, that's
put another particle in lit for the crater
in the additive, that's the big difference here, and it's going to
be really bright. And then we can select all of these modules from
the existing crater. And while all in control, drag it right here,
it will duplicate. Make sure you connect
this curve to the Z of the set
scale, and that's it. Now, as you can see,
it's fully bright, and we are going to
fix that in a moment. For now, let's make
sure it fades. We set color of alive, switch the composition
to multiply so it doesn't overwrite
the set color, and we can actually use a curve. If we set the mode to uniform, we can use a curve
similar to this one, but it fades sooner
around zero dot six. And then we can adjust the
handles for a smoother fade. Now, all we need is a proper
texture to mask this out. So if you go back
to material maker, we can actually copy
these nodes that we used to create this texture.
Paste it down here. Let's select the last node and make a few
adjustments, for example, the shape could be smaller and feel free to adjust other
settings, obviously. But in our case, we want to adjust colorize so
it isn't so bright. This key can be
around Zal at five. We are going to
export it as a PNG, rename it to flare
02 as an image, but feel free to test different
settings on each node. Once we go back to VFX Graph, and once you have
assigned right there, this is the result you get. Basically, we are masking
the rest of the mesh, and it only shows where
the texture is bright, creating that very cool feeling where it's bright on the crater. We are leaving it gray
on purpose, the crater, but feel free to
add texture to it, so it matches your ground. Now let's do the same, but
instead of being bright, it's going to leave a
dark mark on the ground. So let's copy this
entire output. Connect it from here, and one of the main changes is setting the blend
mode to Alpha, saying the set color
is completely black. Oh, let's not forget to connect this curve to the Z
axis of the set scale. Can remove the
color of life down here and replace the
texture with another one, like, for example, a beam 01, which basically it's a
very straightforward text. If you go back to
material maker, we can begin with a shape
and set it to a circle, and that's pretty much it. We need to decrease its size and then increase its feather, and that on its own could work, or you can improve it and use a Goshen blur with a grid
size of 1024 by 1024. And then remove the
black background with a colorized node by saying the black E as an
Alpha value of zero. And you can export it as a PNG, call it beam 01, and
there you have it. All we need is to say that
the order of this output, the sorting priority
is minus one, so it's rendered
below. Here we go. And now we have the bright flare and then that dark spot,
and it's super cool. Now as a good practice, you could rename this
like crater mesh, then the meteor mesh, then the glow, and
then the dark. This is very useful. So
when you select VFX Graph, you can see in which order each output is
rendered right here. So this is what we
have at this point, and it's looking
quite impactful. But since we have a
crater, we have a meteor. It's so impactful, now let's
at some debris, right? So let's find some room between the particles
and the crater. And let's copy this parts, these two cut the debris. We can actually remove this entire system and we
can connect from the crater, the trigger to the GPU event. We don't need that many debris. Capacity of 15 should look fine, and they can leave
much more like 2.5 seconds and almost 5
seconds, for example. In terms of cone, the base radius
could be smaller, as well as the top radius, and that's it, so they don't
spread that much around. So don't need to move that fast, so maybe two and ten,
we'll do just fine. We will see how it goes. We can increase the
gravity to minus ten, and the new thing
we can add is make sure that they collide
with the ground. Remember, VFX Graph can
only do basic collisions. So let's use a
collision shape plane for the bound 03 and
for the friction two. The friction stops it
from sliding over. In terms of output, let's drag this to
the right because we want to focus on
the debris itself. So let's use an output particle, shade the graph mesh, and lead. Let's just disable the connection
to the sparks for now. We go, we can see
these tiny cubes scattering over the
ground. They look great. One thing we can
use is a set size. Let's drag and drop
while holding control to duplicate it. Zero
at four and one. I know they are kind of huge, but we are going to replace
the mesh in a moment, and they can also have
a random rotation. So let's just a set angle. Random, 0-360 on all of
the axis. Here we go. And they can shrink over time. Yeah, Dragon drop this
one while in control. Okay, let's fake something. Let's fake their rotation in the air with a set
angle over life. But let's change
the mode to uniform so it rotates on all
of the axis random. Let's make sure they rotate
from a value of 3,000. I know it's a lot, but they
have to spin really fast, and then we are
going to stop it. So you can press A to see all
of the graph, by the way. And on the last key,
the value is 200. Maybe that's a bit too much, but you could also
make sure they stop rotating a
little bit sooner, by the way, so they don't
rotate on the ground. Either way, let's
move on because now we want to also use
the fennel shaders, so they are bright
like the meteor, but we need a new mesh
instead of using blocks. If we go back to Blender, we can show you how
to create debris. It's a pretty cool technique. We can first go to
preference and in addons, use cell fracture, so we
can fracture objects. Turn it on, and then we can begin with Shift A
and with a cube. Select the cube, and then
search for cell fracture. A lot of settings in here, but essentially, we want to
increase the source limit, and recursion is if you want to break more than
the same fragment, you can say at least one time, and let's set noise to one, and let's see how it goes. We just need one
or two fragments. For example, this fragment
right here, we do just fine. Find one similar,
and then we can invert the selection and
delete everything else. Be careful if you
have the crate or the met you are showing.
Make sure you wide them. Otherwise, you will
delete essentially, with this fragment right here, we want to go to object and
set the origin to geometry, and then we shift as we want
to say selection to cursor, so it goes to the center. Basically, we are trying
to center this as well as the pivot
of the mesh itself, and that's what we did.
It's looking good. From there, you can rename
it to fragment or debris 01. Forget to apply all transforms, or you can simply
export as an FBX. Make sure you turn
on selected objects and export to your project. Back to VFX Graph, you can replace the cube
with the debris, and this is what we
get at this point, as you can see,
it's looking good. Now, let's reuse
some of these nodes that we created for
the meteor mesh, where it's bright and
then it fades away by selecting these nodes,
and then with Control C, Control V, copy and
paste them right here, and then connect
it to the color. So it looks like little bits of the meteor are
scattering around. Nice. Looking good. We can actually delete
these output sparks. Rename these to debris meteor. Now that we have some
very bright debris, let's work on adding some normal debris as if
the ground was breaking up. So let's copy this
entire system. Connect the trigger
to the GPU event, and let's work from
the top for that let's disable the meteor debris and increase this
capacity to 20. Maybe these ones can
leave longer 45 and six. Let's connect the
position source to the position of the cone. So it spans exactly
where the meteor hit, and we can work on increasing the base radius as well
as the top radius. So it's a larger
cone essentially. As for the velocity, I
wouldn't change it that much. Maybe the minimum can be three, but it will work
just fine as it is. Let's try to increase
the gravity. Maybe they don't bounce that much and have much
less friction. Yeah, basically, they jump, and then they stop
pretty much right there because they are heavy
blocks or bigger blocks. In our case, we are going to use an output particle,
URP lit mesh, but feel free to
use a Shader Graph or something else to add
texture to your debris. Let's disconnect this
output and make sure the new one is set to
uppack without smoothness, so it's similar to our
ground, basically. And we can drag the set size, and we are going to expand
the minimum and the maximum. So we have smaller fragments
and bigger fragments. And we have a bunch of
cubes right now, which, if it was a vaxll effect,
would look awesome. Let's drag the size
of our life so we can say that towards the end of
the lifetime, they shrink. So basically, the time of the first key is going
to be zero at night. Instead of cubes, we have
already debris mesh, we created, let's use
that one. Here we go. In this case, we are
not going to use any text because
it's a gray ground. That's what we are
trying to mimic. You can also drag the set angle, so it's totally random, and here we go, it's looking good. We can delete this other output and call this one
maybe debiezeGround. Let's reconnect this GPU event
up here, and here we go. Both debris, some are
bright, others are not. And if we enable
everything else, we get a pretty cool effect. Here we go. Very impactful. Let's work on adding
a few more details like some floating embers, for example, we can reuse this park system.
So let's copy it. Call it embers. We just
need one of these systems, and we can connect
the trigger, as well. Maybe increase the capacity. So there's a few
more flying embers and they definitely
need to live longer. So they stay there
floating a little bit, like one and 2.5 seconds. The embers should come
out of the meteors, so volume of the
cone can be smaller, and we want them
floating, right? So maybe the
velocity is smaller, too, like one and eight. Now, in terms of
update particles, we don't need to continuously push them down with gravity. We actually want the opposite. If we use a linear drag, they start slowing down. They still go up,
but they slow down. And then if we want them to
move around a little bit, we can use some turbulence. We need to adjust
a few values here. For example, the frequency of
frequent the turbulence is, let's set it to two, and the intensity only
make it random. For the B option, random
value 2-10. Here we go. As you can see, they
are moving around, which is really nice
in terms of motion. As a matter of fact, we can use the A option with a curve, so these turbulent slows
down as they fade away. And the last key, we
can push it back so it stops sooner the turbulence
to zero at eight. To animate curve, we can
use the age of lifetime. Now, as you can see in terms of motion, they are
pretty much there. Let's take care of the aspect. Let's rename the output to embers and we don't
want to stretch them, so we don't need to align them
with our velocity vector. We can simply orient
them to frees camera. And in terms of size, they can be smaller off of
the size we have pretty much. We don't need set
scale to stretch. And that's it. If we
enable everything else, we get those nice flying embers coming out of the center of
the crater of the meteor, and that looks really
nice. It's a nice touch. We can also add a few more
details to the crater, to the aftermath, for example, like smoke coming
out of the impact. Since we already
have smoke here, we can copy those
systems, that group. Let's delete this system. Rename these to
SmokeCircle or smoke crater and connect to
GPU event right here. And we are already
probably reaching the maximum of events we can connect to a
trigger by the way. Way, in terms of capacity, we can leave it at 100. It's a lot, but it's VFX Graph, and it can handle it easily. The smoke itself can live longer 1-3 seconds, more or less. In terms of position, yeah, we want this to be a cone like the other stuff we have
been adding to the crater. We can connect the
source position to the position of
the cone, right? So it goes to the
impact position. I can have a very
small base radius, but it can be wider at the top. It's a small cone
but wide at the top. To make sure the smoke goes up, we can use again the velocity from direction and speed module, and it can be random with a minimum and maximum speed
of four and 12, for example. That's disabled direction blend. Here we go. We have a bunch of smoke going sideways,
as you can see. Let's make sure we slow it down. In the update
particles, we can use a linear drag with
a value of two. And as you can see,
that's a huge difference, it looks much more
realistic now. Maybe the smoke overall can be smaller each particle, 3-5. It's a nice smoke goes a little bit sideways and
then it fades away. Let's add a few more details. Let's work on the trail. For now, it's a smoke and fire. What if we left some embers, some particles behind?
That would look very good. So let's work on that. We
can, as a matter of fact, copy the ember system, paste it right here, add it to the trail group,
make room for this. And in here, basically, what we can do is remove
this set position and copy with Control C control V. This position from the trail, it will save us some time. Let's push the set
velocity below. We can also connect the source to the position
of the transform. Oh, and before moving on, let's connect the trigger
to the GPU event. This trigger right
here. This way we can see how it goes. Here we go. It's already looking pretty
good, as you can see. Maybe we can increase
the capacity to 100. Yeah, so there's
enough particles to spawn as the meteor
goes. Here we go. And that's looking really nice. It's another detail, very easy one with what
we already have. Now for something a
little bit more complex, let's add a capsule
to the meteor, as if there was a burning
hour around the meteor. But first, let's make a
few changes to the meteor so it's easy to visualize
what we are going to work on. For example, we are going to
need to add another output, a Shadograph mesh and lead. We can disable the triggers. Disable this set velocity, add another one that
moves only on the X, small value like two,
and on this output, we are going to add the capsule. It's a new mesh, so let's
open up Blender again, and with Chief, we
can add the sander. We are going to
begin with this one. We want to make sure the
CAP field type is set to nothing so there's no top and
bottom face on the sander. Then we can rotate it with
R on the X value of 90. Press tap to enter the mold, and we control R, we can
add around four edge loops. Press Enter in the next scape so you stay in the
same position. Let's just visualize the
meteor here for a second. We want to make sure that it's closed at the front Dsuner. Basically, if we select
this front edge loop, we can shrink it
down almost to zero. And the next edge loop, we can push it a little
bit on the Y axis and then shrink it down with. The next one, we can actually push it in
front, but scale it up. This way, we can select the
other three edge loops, push them back. Here we go. And then select this edge loop, push it to the front,
scale it a little bit up, and then we can scale the
other ones exactly like this, each one being bigger than the last one, but not too much. Basically creating this
capsule right here, as you can see. And that's it. That's
pretty much done. As for the UVs, we
want to make sure that the front part of the capsule is the right side of the UVs, which is not happening. It goes from the bottom to
the top, as you can see. So on the UVs, you
can select everything and we rotated 90 degrees. This way, when we select this, it goes from the
right to the left. We are doing this, so the shade that we
are going to create works properly with the text that we are going
to create as well. We want an horizontal
pen, basically. Set just a little bit the UVs, so it matches with the mesh. Something similar to this. It will work just fine. In object bow let's make
sure we apply rotation. And then we can rename this to Capsule 01 and export as
an FBX to your project. And once we go back to it, we can add it right here. Not visible, so let's make sure we say the set size is one. You might need to say
the scale factor is 100 if you select the
meshing Unity, by the way. So it's sideways,
as you can see, to align this easily, we can use an Orient block
set to along velocity. Since it already a velocity, it will align with velocity
vector itself because we modeled this capsule
facing the proper axis. Now let's create
a very simple pan Shader so we can scroll a text. Let's create a new
Shader Graph URP unlit. We can call it the ScrollShader. In here, we want to say that the surface type is
transparent, for sure. The default blending
mode can be additive. Let's disable cast shadows, and let's say enable support
theft graph down here. Here we go. Looking
good. Let's save it. It's going to be a very
straightforward shader. In this case, we need
to sample a texter. So let's search for
that and we can also expose the property
for a text to two D. We can call it noise texture. It's going to be a
noise, and we can show you how to create
one with material. Actually a very
interesting noise. You can begin with a shape
node, set it to a circle. We're going to use a bunch
of circles, smaller ones. We can increase the
faith. Here we go. And then we can connect
this to a tiler, and it will repeat this
in a grid like shape. You can increase the t
X and Y to ten by ten. Basically, a lot of circles, and they can overlap
a little bit. No problem. You can
increase that value. Want to make them bigger, zero at seven on the X and on the Y. We don't necessarily
need fixed offset. What's important is
the random offset. Let's set it to one
and it looks like a Voronoi or some cells.
It's pretty cool. But we need to say
the random scale is above zero at seven, something like zero at
eight, for example. From here, if we invert this, we get a really awesome
effect. Here we go. Looks like skin under
a microscope almost. And if we blur this, we get
a totally different effect. But we don't want to blur
that much, just a tiny bit. So let's increase the grid
size to 2048 by 2048. And from here, we can
use a colorized node. You can use one to intensify the dark areas or make
it even more bright. In our case, we want to
intensify dark areas. Something around these values, 025, maybe make the brightest
spots a tiny bit brighter. Yeah, it's a little
bit up to you now. But this is the workflow
for this awesome texter. We want to export
it now as a noise 2048 by 2048 and as a PNG. Back to ET, we can add
it as a default to the noise texter and dragon drop this property and
connect to the texter. Here we go. We already
have the noise text. Now let's work a little
bit more on the Shader. If we want to scroll this, we can use a tiling
and offset node. It's very straightforward. We have the tiling to control how many times it repeats,
and then we have the offset. Well, it offsets
the text, right? We want an automatic offset. So let's use a time node. And in this case, it needs to be multiplied by a vector to, so we can control it speed
horizontally and vertically. So let's call it noise speed. It can have a default
value of three on the X, for example, and
then we multiply this with time and
connect it to the offset. And here we go, as you can
see, it's scroll horizontally. From here, we can add, for
example, color to this. We want to control
the color of this. In HDR mode, white
as the default, drag it and multiply
it with a sample text, connect this to the base color, and to have transparency, we need to connect
it to the Alpha. But first, we need to
split this vector four. We have the RGB and A and A represents the Alpha,
the transparency. We can connect it to right here. It's a very
straightforward shade, but it's super powerful
and very common. We can add it to our
Shadograph this is the effect we get
because we have this default dot as a texture. But now since we have the noise, we can replace it
and hide it right here and we get this
very cool effect. We need to work a
little bit more on it. We need to mask it
because we don't want to see the end of
the capsule, right? We just want the front of
the capsule to be bright. So we can copy this sample
text to D because now we can create another text to
the property for the mask. Can use this
gradient right here, which is extremely
easy to create on material maker with
a simple gradient. From here, we can control very easily how that
gradingt looks. For these peculiar gradients, we want the last key
not to be super bright. And then add more or
less a key around here, which is not going to
be that bright as well. And then instead
of linear because as you can see on the
preview, it has a cut. We want it to be cubic
and it's going to go smoothly from black
to almost white. Free to try different gradients, and you will see how it
affects the shaders. Now, let's export
this as a PNG text to Unity and then add it to the mask as default and connect the mask texture
property right here. And the way this works
now, it's super easy. We basically multiply
these two together, the mask texture and
the noise texture, and then replace connection
to the color, and that's it. If we go back to Veec graph, we can already see
the mask in action. Now it's only a matter of
increasing the brightness and choosing a color that matches something like
this, for example. Very basic capsule. By the way, we could improve this
in several ways. But since it's going to be super fast, it will be just fine. If we remove the set velocity and enable the previous one, and then we can enable the
triggers for the trails, and we have a very
simple capsule that really adds a nice touch. It adds that burning
hour to the meteor, and then we have an awesome
impact. That's it, folks. Now we have a working
meteor effect done with VFX Graph
and Shader Graph. You can still try to improve it and add a few more elements. Feel free to play along with it. We have seen a lot
from modeling, from creating textures,
shaders and in VFX Graph. I hope you have enjoyed guys. And we have plenty
more of these effects, these tutorials, these lessons, where we create visual
effects for games. So feel free to check my profile to find out more about it. So that's it. Thanks for watching and see you
on the next one.