Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Bug?]Sorting Group + Sorting Fudge

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

  1. kvfreedom

    kvfreedom

    Joined:
    Mar 30, 2015
    Posts:
    27
    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:
    567
    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:
    27
    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:
    27
    1.png 2.png 3.png 4.png
     
  5. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    567
    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:
    27
    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:
    567
    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:
    27
    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:
    99
    Last edited: Jun 18, 2020
unityunity