Tip:
Highlight text to annotate it
X
(buzzing)
Voiceover: Hi, everybody. This is Bill Kladis.
Thanks for joining me here, on ImbueFX.
Today's topic is going to be a quick tip
on how to use Alpha Erosion inside of your particles.
Now, Alpha Erosion goes by several different names.
You may have heard it called as Alpha Dissolve,
or Black-point Fading,
but no matter what you call it,
the concept is basically the same.
Instead of multiplying out our Alpha,
like we've typically done in previous tutorials,
we're actually going to subtract from our Alpha,
and clamp it.
What this is gonna allow us to do,
is to give the impression that our Alpha
is being eaten away or dissolved,
instead of simply fading out.
To show an example of this,
we can see the particle system on the right, here.
This is the cigar smoke from Chapter 8, I believe,
in the Flow Map tutorial.
It looks good. It's convincing.
But, what we see in top here,
is that the particle fades out very uniformly.
Now, this works okay,
but some styles of smoke, or certain types of smoke,
actually dissolve from the outside-in.
The example on the left, here,
is the same particle system,
but with our Alpha Erosion applied.
What we see here is it loses that soft,
smoky quality to it, and it's being eaten from the outside,
like we've said before.
To understand how to do this,
let's go ahead and go into the material.
I'm gonna close down this final example, here,
and I'm gonna bring this material window up.
Now, this is the same setup that we have
from Chapter 8 in the Flow Map tutorial.
I'm just gonna make some room by selecting everything
that's related to our Alpha,
right before it goes into the vertex color.
I'm just gonna move this over and make some room.
Now, to preview this a little bit better,
inside of the material editor,
I'm gonna use my sine wave previewer.
If you've watched any of my tutorials,
I think I use this in almost every one of them.
It's very, very useful.
What we're gonna do is drop in a sine wave,
and then look for a time expression for our input.
Plug that time into sine.
Now, this is oscillating from 1 to -1 space.
Let's go ahead and change this period to 5.
This is gonna slow it down so it's not so quick.
Let's bring in our Constant Bias scale.
This is gonna scale it out from 1 to -1,
and bring it to 1 to 0 space.
We've got that set up.
Let's go ahead and bring this in,
right where our vertex color is going in.
Now, this fade that we see here on the left,
even though it's happening slowly,
this is exactly what we're seeing typically
in almost every tutorial I've done.
We're just fading out the particle very linearly.
Every part of it, no matter how bright it is,
is being faded the exact same amount of time.
Let's change this up a little bit,
and let's go ahead and delete this multiply,
and let's bring in a subtract.
I'm gonna search for "subtract."
I'm gonna take this lerp, here,
which is our alpha channel, ultimately.
I'm gonna plug that into A.
I want to make sure that this is going in on the top,
because we're gonna subtract away from it.
So, remember order of operations is important.
Just for previewing purposes, let's go ahead
and bring our sine wave previewer,
and plug that into B.
Let's plug this result, now,
that we subtracted into opacity,
and see what we get.
It's starting to work.
We can see that the white values are being eaten away.
However, we see a really, really nasty black border happening,
or black matte in the background.
What's happening here is that we have values
that are going below 0.
Those negative values are screwing up
with our alpha channel,
so we need clamp it, to say,
"Hey, I don't ever want you to go below 0,
"so we get these erroneous results."
So, we're gonna search for Constant Clamp.
Let's go ahead and drop that in there.
Let's put the Constant Clamp in between
from our subtract expression
to our opacity input in our material.
Now, this is looking pretty good, right?
We can see that we've got a clean matte background.
This is the basics of Alpha Erosion.
Let's go ahead ... I wanna be able
to control this with our vertex color alpha, right here.
Let's go ahead and duplicate this
just for a little more organization.
We no longer need our sine wave previewer,
so let's go ahead and plug in the vertex color alpha
into Subtract B.
Right away, this disappears,
and this is kind of a red flag.
But, let's go ahead and compile this,
and see what we get inside of Cascade.
We do see some smoke textures,
but we can see that it's not
really being controlled the way we want it.
There's some funny things that are going on,
the way it's popping right here.
What's happening, there's actually 2 things.
The 1st is that we've got some different values, here,
from our previous flow map tutorial,
that aren't really working with this kind of material setup,
so we do have to do some changes, here.
Let's go into our Init. color,
which is setting the start value of our alpha.
Right now, it's arranged from 0.6 to 0.2.
Let's just change that to constant and leave it to 1.
Let's also take our other Init. color,
change that to constant, and set it to 1.
Then, our Scale Color over Life modules,
which are shared, if I graph this ...
Let me move this over, just so I can see that.
Make a little more room.
If we graph this and do "Fit View to All,"
we can see the 2nd point right here,
which is supposed to fade the particle in a little bit,
is only set to 0.4, so let's set that to 1.
Now, it's doing some backwards things, now.
This is a little bit of strange magic that's happening here,
because at the bottom,
the particle is just visible a little bit,
completely disappears, and then comes back again,
and then pops off.
This is partly with the way
the material is set up as well.
What's happening here, if you follow the logic,
it's actually pretty simple.
This value of 1, which is coming out of our vertex color,
which is supposed to be completely opaque,
is actually being subtracted,
which is bringing it closer to black.
Remember, values of black are more transparent.
We actually need to invert this,
so that it behaves properly.
Let's go ahead, and search for OneMinus,
which is our inverter expression.
You can also hold down "O" on the keyboard,
and then click, and it'll bring in OneMinus as well.
Then, let's go ahead and invert our Alpha channel.
Then, bring that inverted value into our subtract.
Now, we can see that it's popped in.
It's looking pretty good.
Let's go ahead and compile,
and see what that looks like inside of Cascade.
It looks much better.
It starts off much more opaque,
and then it dissolves as it gets towards the top.
Now, there's 1 other thing that I really don't like.
That's, I don't still have that level of control,
where I want to make the particle
a little more transparent, right?
There are several different ways you could approach this.
You could re-multiply the alpha over here
with the vertex color before it goes into opacity.
Like we've learned before, dynamic parameters
are actually really useful inside of Cascade.
We happen to have one that's free, right?
We used 3 of them for ... Our flow map uses 2 of them.
We've got that Blur Control that's using the last one.
But, Parameter 3, which is the blue channel, is wide open.
Let's go ahead and duplicate this.
Bring this over by our Constant Clamp.
Hold down "M" to bring in a Multiply.
Let's multiply this, now, by Parameter 3.
Then, bring that result into opacity.
We won't see anything change in here, because remember,
this is a default preview value of 1.
Let's go ahead and rename it for organization purposes.
We'll just call this our Alpha Control.
Now, let's go ahead and compile this.
Now, it will disappear completely, and that's okay,
because remember, the default values
for the Dynamic Parameter Module
inside of Cascade are always 0.
We've got these 4 right here.
Remember, we connected the 3rd one,
which is 0, 1, 2, actually,
so don't be confused by that.
Let's go ahead and open that up,
and then change this default value to 1.
So now, this pops back in,
but what we can see is if we do a value of 0.2, let's say,
it did fade it out without affecting
the Alpha Erosion that we're learning to do.
This is giving us independent control between the 2.
So, we need to go into our Dynamic Parameter Module
on our 2nd [emitter], and change that to 0.2 as well.
Maybe 0.25. Make it a little more opaque.
That gives us a lot of control.
That's actually gonna wrap up our tutorial,
but feel free to play around
and explore the different options
because this is just the tip of the iceberg.
For example, instead of subtracting the vertex color,
you could actually have the vertex color
being multiplied against another texture,
so a repeatable cloud texture, like we've used.
That is what gets dissolved,
so you actually get some different dissolving patterns.
You could also set up a version of this,
and then lerp between a regular version
that we're multiplying against,
so you get some fading between the 2.
Again, there are a lot of possibilities.
Feel free to explore.
But, this is the basics of how to do Alpha Erosion,
which again, gives you a little different approach
and different style to do doing fading particles.
So, hope you found this useful,
and hope you join us for future tutorials.
This has been Bill Kladis.
Thanks for joining me here on imbueFX.