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:
    1,307
    "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:
     
    JG-Denver, DavidMiranda and Stein_69 like this.
  4. EE_LBisson

    EE_LBisson

    Joined:
    Oct 4, 2021
    Posts:
    1
    You can use the Age over lifetime node to update your shader properties with curves or color for example
     

    Attached Files:

    Hzzzzzppl and Marie_G like this.
  5. Marie_G

    Marie_G

    Unity Technologies

    Joined:
    Mar 9, 2021
    Posts:
    76
    Hi, This solution is the expected workflow, thanks for helping the community!
    We would like to improve the way we control SG properties in VFX Graph in the future, by easing the workflow. Hopefully we will be able to fit this into the roadmap in not too long :)