Color over lifetime not getting alpha

Hello, I am looking for a way to replicate VFX in VFX graph (which originally created using particle system) and stuck on this step:

I add “Color over Life” module and set it to multiply
but it seems to affect only the color of particle. and no transparency:

I use the same shader on both normal particle system and VFX graph:
Here’s the results: the bottom is normal particle and the top is made with VFX graph
8388969--1106661--vfxgraph.gif

Hey could You show you’re ShaderGraph ? As it might be related to how you set up your ShaderGraph.
Or you can share a small package with your VFXGraph so that I can take a look.

Yes, please take a look
deletedAttachment

Okay so I’m not totally sure of myself, but my quickly looking at it.
You got a “Color” property in you Shader that you use to drive your particles.
This Color property got 4 components. The first 3 define the color and the 4th is setting the Alpha.
The VFXGraph part seems correct , but in your ShaderGraph you don’t use the Fourth component of you color Property.

You should use it somewhere in the “Alpha” part of your SGraph.
Does it make sense?

Ah yes. You’re absolutely right!!!

In particle system it get alpha from Vertex color (but I don’;t know how to affect vertex color in VFX Graph so I modify the Color variable)

Thank you very much. This solve the problem.


Here Are a very simple setup that might help you.
As you can see the Color Property Wire Change Color from Pink to yellow.
It means that the the Data is “Converted”. Here From 4Float vector to 3F vector when going to the Base Color.
The Fourth Component, that is Link to the Alpha Attribute in VFXGraph needs to be put in the “Alpha” output of the ShaderGraph.

Hope this quick example help.



8389203--1106784--Unity_SjxeduGftA.gif

2 Likes

Glad to hear that your problem is solve.
VertexColor node should allow you to access the VertexColor of your Mesh.
By default if you didn’t created any VColor on your Mesh, this should Default to VertexColor of Pure White and Alpha 1.

Here is a plane that have been subdivided. I’ve setup random Color and Alpha in the VertexColors in my DCC.
I can Access this data in ShaderGraph and/or VFXGraph by using this VertexColor Node.


my Plane Mesh in my DCC:

I got 1 more question that I forgot to ask:
When I only put the shader above to a new Simple particle system (which using Output particle quad) and leave everything else as default, nothing is rendered

It somehow only works on Output particle mesh + a quad mesh

8389272--1106808--upload_2022-8-25_18-47-10.png

So the output particle Quad will “Render” Quad on your Particles position.
This Quad have VertexColor = (0,0,0,0).
So this is why it’s not showing.
In your ShaderGraph, you’re using the VertexColor.Alpha and multiply other inputs by it to put in the Alpha.
As the “Default” VFXG Quad have vertexColor of (0,0,0,0) , you’re quad Won’t Show…
But with the Mesh Output, the “Quad” mesh seems to have vertexColor of (1,1,1,1).

8389335--1106817--Unity_qhqrEtGkR2.gif

1 Like