Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

VFX graph particles not affected by "Set Alpha"

Discussion in 'Visual Effect Graph' started by garyalanridgway, Apr 18, 2022.

  1. garyalanridgway

    garyalanridgway

    Joined:
    Jul 5, 2017
    Posts:
    4
    Hello there! Hope you are having a nice day!

    I have been trying to get a particle system working but I just can't seem to get it right. I did the following things to get to where I am:
    1. Created a mesh to output as a particle
    2. Created a lit particle system outputting this mesh
    3. fiddled with the rotation over time and whatnot
    4. created a shadergraph vfx graph for texturing the particle (This uses some alpha, could this be a problem?)
    My Particle system now looks like this:



    But unfortunately I seem to not be able to further affect the alpha of my particles. I would love to fade them in and out over their lifetime, but adding a `Set alpha over lifetime` to either the `output particle lit mesh`, or the `update particle` sections seems to have any effect. Even here as you can see, setting the alpha to 0 on the face you can see does nothing.



    I am unsure of what to do from this point, so i thought I would make a post here! Thanks for taking a peek!

    Additionally, here is my shader graph vfx graph for reference if it is relevant as well:

     
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,123
    Blocks like Set Color, Set Alpha, Set Size etc. work on particle attributes and they don't know anything about shader. When default shader is selected (graph is set to none) output takes some attributes and passes them automatically to the default shader (including alpha attribute).
    If you set custom shader graph it does not happen and you must pass data you need there - currently the only source of alpha is your texture.

    In short your shader has no clue about alpha from vfx graph. You need to add property in shader graph to pass alpha and then feed with data.
    upload_2022-4-18_15-36-11.png
     
    whyatme and Gooren like this.
  3. garyalanridgway

    garyalanridgway

    Joined:
    Jul 5, 2017
    Posts:
    4
    @Qriva thank you so much for responding! after getting back from work today I looked for the place where you are adding your variable in, and I don't seem to have it on either of my inputs:



    was there something you had to do to get it to show up?
     
  4. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,123
    upload_2022-4-19_4-39-43.png
    You need to implement this in your shader (and multiply property with alpha from texture)
     
    Gooren likes this.
  5. Maeve_

    Maeve_

    Joined:
    Feb 16, 2022
    Posts:
    4
    Hey ! I have a problem with my alpha too....
    if i control it in the inspector or just with a flat value in the shader graph, its perfect, BUT if I use the VFX graph, the alpha dont work... (in the 2nd image, i dont want the black background) :,(
    upload_2022-12-8_11-22-36.png upload_2022-12-8_11-23-17.png
     
  6. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,123
    There is opaque mode enabled, so there is no transparency.
     
  7. Maeve_

    Maeve_

    Joined:
    Feb 16, 2022
    Posts:
    4
    thanks for the help ! It was because a YT tuto said that opaque was good for what i wanted..i guess that was a lie :,(
     
  8. whyatme

    whyatme

    Joined:
    Apr 4, 2021
    Posts:
    20
    This was what I needed, thank you