Search Unity

VFX Shader Graph color not working

Discussion in 'Visual Effect Graph' started by eukolo12, Jul 3, 2021.

  1. eukolo12

    eukolo12

    Joined:
    Mar 19, 2021
    Posts:
    4
    Hi, I'm struggling to get the VFX Graph to work with my custom shader. No matter what color I set in the VFX graph, it will not override the shader color.
    I've created a example here:



    No matter how I set the color in the VFX graph output, it is always the color of the shader, so things like color over life, etc. are not working.
    What did I wrong?
    Thanks in advance.

    Edit: Also with adding Vertex Color in the shader graph there is no effect, rather than additive not showing particles anymore.
     
    Last edited: Jul 3, 2021
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    270
    "Set Color" node operates on particle attribute and the "Color" variable in your shader is completely something else.
    Unless I am not wrong you set particle color to red, but it's not used in your shader, I mean shader has no idea about it, you must set it directly. You can see in the image there is variable "Color" (cyan currently) and this is exposed shader variable and the color used by shader.

    If you want to animate color you can do it by calculating color manualy and feeding to shader (cyan color input) or you can operate on color attribute in Update block and then get it output particle quad and feed to shader (there should be Get Color node or something like this).
     
  3. eukolo12

    eukolo12

    Joined:
    Mar 19, 2021
    Posts:
    4
    You're a genius. I've just started to get used to VFX graph yesterday and still kind of work the way I did with the particle system.

    Here is the solution:
     
unityunity