Issue with Transparency Sorting and Sorting Groups

Hi There,

I have a sorting groups with 2 child renderers.
The first one is a sprite and the second one is a particle system with a transparent unlit material
.
If I activate the Sorting Group, the particles are always in front.
If I deactivate the Sorting Group, it works as expecting taking into account the Sorting Layer and the Sorting Order.

It seems to work if I change the line from DrawObjectPass.cs from:
var sortFlags = (m_IsOpaque) ? renderingData.cameraData.defaultOpaqueSortFlags : SortingCriteria.CommonTransparent;
to:
var sortFlags = (m_IsOpaque) ? renderingData.cameraData.defaultOpaqueSortFlags : SortingCriteria.SortingLayer;

But then there are some glitch with sorting with the 2d sprite shapes.

Any idea how to fix that?

Thanks,
-Tim

Still haven’t found a way to fix this.
Any update?

Each material has a renderQueue property. That means your particles and spirte materials are in different render queue.

Now, I think I know why you have this. It seems the standard URP shader gui is offsetting materials to a different queue to make priority be negative but seems like this was not a good idea and we have to change this.

I see. I am not sure to completely understand.
This said, changing the priority of the material doesn’t change anything.
The only thing I can see is that if I change the Surface Type from Transparent to Opaque, the sorting order is taken into account. If I switch back to Transparent, the sorting order is not taken into account and the particles are always in front.
PS: This is in when there is a Sorting Group component at the root.