Search Unity

[Bug?]Sorting Group + Sorting Fudge

Discussion in 'Image Effects' started by kvfreedom, Mar 1, 2019.

  1. kvfreedom

    kvfreedom

    Joined:
    Mar 30, 2015
    Posts:
    37
    Parent: Sorting Group
    Child 1:Sprite Mask
    Child 2:Particle System

    Particle System Masking is Visible Inside Mask.
    Other parameters default.
    Particle System can be masked only if Sorting Fudge is equal to 0.
    Is this a bug?

    Unity2018.3.6
    Unity2018.1.3
     
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Could you try setting up the Sorting Layer and Order in Layer for both the Sprite Mask and the Particle System such that the Particle System falls between the front and back of the Sprite Mask?

    Posting the setup for your components here as an image would be helpful too, thanks!
     
  3. kvfreedom

    kvfreedom

    Joined:
    Mar 30, 2015
    Posts:
    37
    Sprite Mask-Custom Range is false.
    These three components are default parameters except Sprite Mask-Sprite,Particle System-Masking,Particle System-Sorting Fudge.
    If the Sorting Fudge is equal to 0 or the Sorting Group is disable, Particle System can be masked.
     
  4. kvfreedom

    kvfreedom

    Joined:
    Mar 30, 2015
    Posts:
    37
    1.png 2.png 3.png 4.png
     
  5. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks for posting this!

    This is a bug as the Sorting Group should handle the sorting for the child Particle System entirely, ignoring its Sorting Fudge settings.

    In the meantime, instead of using the Sorting Fudge for the Particle System in a Sorting Group, could you adjust sorting with the Sorting Layer and Order in Layer?
     
  6. kvfreedom

    kvfreedom

    Joined:
    Mar 30, 2015
    Posts:
    37
    Using Order in Layer + Sorting Group seems to satisfy all the requirements. I don't know when I have to use Sorting Fudge. Is the Sorting Fudge better because of better performance?
     
  7. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Sorting Fudge is better used when you have other Particle Systems (or Renderers) which are not grouped under the same Sorting Group. Having a Sorting Fudge changes the sorting distance of a Renderer by the amount in Unity world units, which allows you to sort against other Renderers in your scene (or multiple scenes), compared to Sorting Groups which sorts and groups only the Renderers under that Sorting Group.

    Using Sorting Fudge instead of Sorting Groups would generally have better performance if you update your Sorting Groups and the Renderers within the Sorting Group frequently, as there is an overhead in sorting the Renderers within each Sorting Group. Using a Sorting Group makes managing Renderers easier if you know which Renderers should be logically grouped and drawn together.
     
  8. kvfreedom

    kvfreedom

    Joined:
    Mar 30, 2015
    Posts:
    37
    I think that two particles need to be sorted by distance and sorted in the set order at the same distance. It seems that only Sorting Fudge can be done. I hope this bug can be fixed soon. thank you very much.
     
  9. forestrf

    forestrf

    Joined:
    Aug 28, 2010
    Posts:
    230
    Last edited: Jun 18, 2020
  10. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    Don't know if this is a different bug, but sorting order/layer of the particle system is ignored when the parent is in a sorting group. It still sorts the particles by custom sort axis, which normally is good, but for some effects i want it on top.

    Adding a sorting group to the particles doesn't help. Removing the sorting group from the parent helps.

    Is this a bug? :)
     
  11. UnityMaru

    UnityMaru

    Community Engagement Manager PSM

    Joined:
    Mar 16, 2016
    Posts:
    1,227
    Probably best to report it and the QA team can answer that for ya: https://unity3d.com/unity/qa/bug-reporting