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.

Question VFX Particle Effects Always Rendering Over Shuriken Particles

Discussion in 'Visual Effect Graph' started by Velo222, Dec 24, 2020.

  1. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,436
    Hello,

    I have a game that makes extensive use of the Shuriken (currently built-in) Unity particle system. I noticed that my VFX Graph particles that I created are always rendering over my Shuriken particles in my game scene, however.

    But I would like the VFX particle effects to actually render over (or in the proper sorting distance order) my Shuriken particles. Is there some way to have the VFX particles render over my Shuriken particles?



    What I have tried (unsuccessfully so far) to try to get it to work is:
    1. On the Visual Effect Asset itself in my project folder, using the "Output Render Order" -- but there is only 1 effect so far, and I think it only affects the sorting order of particles made with VFX specifically.

    2. In the "Visual Effect" script component on my VFX effect in the scene I have tried changing the "Transparency Priority" to something very high (like a value of 25).

    3. And finally, when selecting the "Output Node" in the VFX graph itself, and playing with the ZWrite and ZTest options, as well as the "Transparent Render Queue" options.



    Nothing seems to make the VFX particles render over the Shuriken particles.

    Any help or suggestions on how to get the VFX particles to render over the Shuriken particles, or even better to render in the proper distance order?
     
    BigRookGames likes this.
  2. Marrech_g

    Marrech_g

    Joined:
    Dec 29, 2020
    Posts:
    3
    I have a similar problem, i await an answer
     
    BigRookGames likes this.
  3. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Same... I'm finding that setting the Visual Effect Component's Renderer Priority is unreliable in HDRP:

    With the Priority at negative values, transparent materials that also have negative sorting values don't take priority over the Visual Effect even if the materials have higher priority, only when the transparent materials have their sorting queues at 0.

    With the Priority at positive values, transparent materials also at positive sorting values can take priority over the Visual Effect if their priority is greater, but the Visual Effect won't take priority over transparent materials whose sorting values are 1 or greater.

    This is really bizarre.
     
  4. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Just updating this thread with my discovery that VFX Graph material sort priority can be changed via scripting, at least in HDRP, not sure about URP. Please see this post for instructions.

    @Velo222 Perhaps this can help if you use a ShaderGraph shader for the Shuriken particle system, and set that material's (not renderer's) inspector sort priority in conjuction with the VFX Graph material sort priority set by code. I was able to get VFX Graph shaders to sort properly with other HDRP transparent ShaderGraph shaders, so this could work for Shuriken particles.
     
    Velo222 likes this.