#Thread

1 messages · Page 1 of 1 (latest)

snow basalt
#

Can you show the entire graph until this point

#

And what values the Material asset with this shader has

ruby rain
#

Of course, sorry.

#

So, if I make the adjustments per your suggestion and cut out the ring cut out earlier, the graph is:

#

Currently, these are the values.

#

Although the radius/thickness are part of the values attached with the part I just detached.

snow basalt
#

For testing I also wish you to change Material type to unlit and blending mode to alpha blended

ruby rain
#

Sure, of course

snow basalt
#

So, it was invisible because of additive blending, not because of a problem with alpha

ruby rain
#

I only put it as that per something I was reading since I'm trying to use this to let me use HDR color in a particle system.

#

If there's a way I can adjust it so I can use HDR in a particle system and fade out easier, I'm definitely down to implement it that way instead.

snow basalt
#

Both additive and alpha work for HDR fine

#

But additive materials become invisible when dark/black which was concealing what's happening here

ruby rain
#

Yeah, I figured it was something of the sort, just not experienced enough to figure out how to get both effects combined.

snow basalt
#

So, now you can change the Step Edge to determine how much the particle fades in from the center

#

You can control that with particle lifetime, or by the Custom Data module if you want to give it a lifetime curve or randomization or whatnot

#

In the Particle System's Renderer module you can check Custom Vertex Streams and then use the plus button to add a new vertex stream of data to feed to the shader

ruby rain
#

So, turn on custom vertex streams, add a percent life time?

#

And then how do I access that via the shader graph?

snow basalt
#

Percent lifetime should work

#

Once you add it it tells you which TEXCOORD it is

#

likely TEXCOORD0.z

ruby rain
#

Yeah

snow basalt
#

This means you have to use the UV node and get its Z (or B) component using Split or Swizzle node, whichever you prefer

ruby rain
#

So a UV or something?

#

Aight, so looks like it's sort of working

#

but we have big black box remaining?

snow basalt
#

One thing at a time

#

Then since we want a normalized age in 0 to 1 range instead of a percentage 0 to 100, you can multiply the UV.z by 0.01

#

Now the circle should get bigger over the particle's lifetime from nothing to fully wiping it (or bigger to smaller if our math is flipped)

ruby rain
#

Mhm

snow basalt
#

Next, if your particle has its own alpha channel with the circular shape, we can use that to get rid of the square shape

ruby rain
#

So, multiply it.

#

👍

snow basalt
#

First we actually want to use the particle alpha here

#

And add another multiply to multiply this result with the UV.z animated alpha

#

And plug that result into Fragment Alpha

#

And it should pretty much take care of it

ruby rain
#

Yeah, that's connected.

#

Do I need to normalize something with the lerp here?

#

The hole it makes doesn't quite scale well and something seems off there?

#

It only makes a tiny hole unless I put in a very large number.

snow basalt
#

Put a very large number where?

ruby rain
#

Into the lerp node.

snow basalt
#

Could try without multiplying by 0.01 and without the Lerp

#

Just in case the percentage is actually 0-1 instead of 0-100 as the docs claim

ruby rain
#

Ah, that does seem to make it dissolve completely.

#

Originally I was thinking about keeping a ring separate, but at this rate I think I'll just have a secondary particle that's a ring.

#

It does have a nasty black-ish color around it though?

#

Not sure if that's visible from a screenshot too well.

snow basalt
#

That suggests your texture's alpha isn't fading out perfectly well

ruby rain
snow basalt
#

And that it also has the fade in the color channels, which causes blackness also

#

But that's something we'd rather fix in the texture itself

#

You can tune the expansion of the circle with a Power node between the UV.z and the Step

#

But it might be prudent to use a texture with the correct brightness curve baked in, to avoid using Distance and Power nodes entirely as they can get expensive

ruby rain
#

Would there be a way to maybe create some form of animation curve or something

#

where I could make it not start to dissolve the middle of the texture in the first 20% of its life time

#

and then dissolve completely over the remaining duration?

#

Or would that be a headache of sorts?

snow basalt
ruby rain
#

We learning lots about custom data today I guess.

snow basalt
#

I misspoke earlier, we've only been using Custom Vertex Streams so far! Custom Data is a subtype of that

ruby rain
#

Oh, gotcha.

#

Ty for your time and help btw.

#

I appreciate it.

snow basalt
#

Instead of Lifetime Percent we swap it out for Custom1 and enable the Custom Data module

#

While the particle system intrinsically contains lifetime data, Custom Data is an extra channel just for use with shaders like this

ruby rain
#

So, vector?

snow basalt
#

One dimensional vector is what we want

#

Since that's the same as float

ruby rain
#

Gotcha

#

Then just use the x dimension

#

to make the curve.

snow basalt
#

Yes, if you remove the Lifetime Percent, this one should replace it seamlessly

#

Setting number of components to 1 and the X into curve, you can now control it fully

#

It doesn't say if the curve is over duration or over lifetime, but it is over lifetime if I'm not mistaken

ruby rain
#

It works, nice.

snow basalt
ruby rain
#

Yeah, that's close enough probably that I can tweak things.

#

I appreciate all of your help.