Transparency Sort Mode and Lightweight Render Pipeline

Hello,

I have issues with the Lightweight Render Pipeline and the Isometric Tilemap

I want my player to be rendered infront of the object, when behind the object, if want it to be rendered behind.

You can do this with the Transparency Sort Mode, but it is disabled if I choose the Lightweight render pipeline. I need the LWRP for the sprite shader to be affected by light and the Fire which I created with the Shaker-Graph Tool

4365730--395356--Bildschirmfoto 2019-03-27 um 19.52.20.png

is there a workaround for using the Transparency Sort Mode with the Lightweight render pipeline?

Thank you!

The settings for Transparency Sort Mode do not show up with you have a Render Pipeline Asset set in Graphics Settings. As a workaround, if you are using Graphics Settings to handle the Transparency Sort Mode, you can set the Render Pipeline Asset to None, set the Transparency Sort Mode settings now that the option is there, and reset the Render Pipeline Asset. The Transparency Sort Mode settings will still be set even though the UI is gone.

Otherwise, you could try something like this script:

#if UNITY_EDITOR
using UnityEditor;
#endif

using UnityEngine;
using UnityEngine.Rendering;

#if UNITY_EDITOR
[InitializeOnLoad]
#endif
class TransparencySortGraphicsHelper
{
    static TransparencySortGraphicsHelper()
    {
        OnLoad();
    }

    [RuntimeInitializeOnLoadMethod]
    static void OnLoad()
    {
        GraphicsSettings.transparencySortMode = TransparencySortMode.CustomAxis;
        GraphicsSettings.transparencySortAxis = new Vector3(0.0f, 1.0f, 0.0f);
    }
}
13 Likes

Thanks a lot!, ChuanXin.The method to empty the asset temporarily to see the setting does not work (in 2019.1.0f2), but the script does. For other total newbies, go to to Edit > Project Settings > Graphics > Scriptable Render Pipeline Settings and empty it to test out the values you need. Then set the asset again, and make a script in your assets, name it TransparencySortGraphicsHelper, and set the values you tested out before. The script doesn’t need to be attached to anything.

7 Likes

I solved this problem, there is a file New 2D Renderer Data. 7643659--952615--upload_2021-11-10_11-17-42.png

5 Likes

While this was not part of the original question I would like to add that the same is true for the Universal Render Pipeline - to configure the Custom Sorting Axis you have to remove the asset and add it again afterwards.

(I was struggling with this myself so I hope my comment will make this solution come up in Google search for people using URP instead of the LWRP as well :wink: )

Why this isn’t working for me ? I copy the script :stuck_out_tongue:

Big thanks!

For those new to this problem. If using URP. Go to your Assets folder then Settings and in there will be the Renderer 2D data object. Select it and change the Transparency Sort settings in the Inspector. (Works for both Editor and Game view)

11 Likes

that´s the best and quickest solution, thanks!

If you’ve setup URP on your own without starting with a URP project, Create > Rendering > URP > 2D Renderer & set the Renderer for your Camera