Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Help Wanted Shader Graph shaders and particle sorting fudge

Discussion in 'Shader Graph' started by Carl_Campbell, Sep 18, 2019.

  1. Carl_Campbell

    Carl_Campbell

    Joined:
    Apr 14, 2016
    Posts:
    7
    Hi there,

    I use a mix of standard particle shaders and custom graph shaders for my VFX and when I combine both types into a single particle system, I notice that I'm only able to fudge sort the custom shaders between themselves and the standard ones amongst themselves, but I can't ever get one group to draw over the other; the custom shader particles will always draw behind all the standard shader ones.

    Has anyone had the same problem and how did you solve it?
     
  2. LandonTownsend

    LandonTownsend

    Unity Technologies

    Joined:
    Aug 21, 2019
    Posts:
    25
    If you select the VFX graph in the inspector you should be able to change the Output Render Order from there:
    upload_2019-9-18_11-22-52.png
     
  3. Carl_Campbell

    Carl_Campbell

    Joined:
    Apr 14, 2016
    Posts:
    7
    Thanks for your response, but I'm not using the VFX Graph at all, just regular Particle Systems.
     
    richardkettlewell likes this.
  4. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,380
    Are the render queues the same on each material? (The standard price shaders set it for you based on opaque/fade/transparent sort mode etc.) I would expect SG to offer some equivalent.
     
  5. Carl_Campbell

    Carl_Campbell

    Joined:
    Apr 14, 2016
    Posts:
    7
    It is possible to set render queue values for SG shaders, yes but I'm not sure about the values for standard shader. Fade doesn't seem to even be available on latest versions, only opaque and transparent.
     
  6. Carl_Campbell

    Carl_Campbell

    Joined:
    Apr 14, 2016
    Posts:
    7
    Now that you mention it, Graph shaders default to a value of '3000 Transparent' so I guess that's the same as a built-in shader set to Transparent, but this is where I have the problem.

    Could you please confirm if 3000 is what the default shaders are set to? Because as I mentioned, I seem to not be able to fudge paeticles between shader groups.
     
  7. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    8,334
    3000 is indeed the default, but more importantly look at what is set on your materials. Materials can override the queue set by the shader, so make sure it’s showing either 3000 or “use shader” and your Shader Graphs are set to be Transparent.

    If that’s all true, then Unity’s built in draw call sorting may be overriding the fudge factor, as the sorting algorithm may try to keep the same shader together to improve rendering speed. Usually most of that gets disabled with transparent sorting though.
     
  8. stevenwanhk

    stevenwanhk

    Joined:
    Jul 20, 2016
    Posts:
    105
    How do we override render queue?
     
  9. Carl_Campbell

    Carl_Campbell

    Joined:
    Apr 14, 2016
    Posts:
    7
    At the bottom of a Material parameters.
     
  10. stevenwanhk

    stevenwanhk

    Joined:
    Jul 20, 2016
    Posts:
    105
    Sorry, could you include a screenshot?
    I can't find any render queue parameter
    What I can find is:
    1. I can change Sorting Priority to affect render queue, but can't be more than 100
    2. I can see Custom render queue in inspector in debug mode, but it got reset after modification
     

    Attached Files:

unityunity