#Thread
1 messages · Page 1 of 1 (latest)
Can you show the entire graph until this point
And what values the Material asset with this shader has
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.
For testing I also wish you to change Material type to unlit and blending mode to alpha blended
Sure, of course
So, it was invisible because of additive blending, not because of a problem with alpha
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.
Both additive and alpha work for HDR fine
But additive materials become invisible when dark/black which was concealing what's happening here
Yeah, I figured it was something of the sort, just not experienced enough to figure out how to get both effects combined.
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
So, turn on custom vertex streams, add a percent life time?
And then how do I access that via the shader graph?
Percent lifetime should work
Once you add it it tells you which TEXCOORD it is
likely TEXCOORD0.z
Yeah
This means you have to use the UV node and get its Z (or B) component using Split or Swizzle node, whichever you prefer
So a UV or something?
Aight, so looks like it's sort of working
but we have big black box remaining?
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)
Mhm
Next, if your particle has its own alpha channel with the circular shape, we can use that to get rid of the square shape
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
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.
Put a very large number where?
Into the lerp node.
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
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.
That suggests your texture's alpha isn't fading out perfectly well
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
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?
Sure, while that could be done in shader math, the most practical option probably is particle system Custom Data
I misspoke earlier, we've only been using Custom Vertex Streams so far! Custom Data is a subtype of that
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
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
It works, nice.


