Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Bug The Transparency options for "2D Renderer Data" on URP Assets are broken, unused, or undocumented

Discussion in '2D' started by fmoo, Sep 5, 2021.

  1. fmoo

    fmoo

    Joined:
    May 31, 2015
    Posts:
    15
    I've gone and tested this feature on every version of URP I could find, from 2019.3 to 2021.1, and they just don't seem to do anything, even on 2021 where it's no longer marked "Experimental":
    upload_2021-9-4_18-21-57.png

    It's even included in the screenshot in the docs, but the docs themselves don't seem to bother explaining them.

    This is the equivalent setting that is shown in Project Settings Graphics, when no custom asset is used.
    upload_2021-9-4_18-28-8.png

    But, when using a custom render pipeline asset (including the reference to 2D Renderer Data), the settings are hidden, I assume because you are meant to use the settings on the Renderer 2D Data.
    upload_2021-9-4_18-28-27.png

    But... while the Graphics setting version does work when no URP asset is set, the setting on the 2D Renderer Data does not work and does not seem to have ever worked.

    The only thing that seems to help is if I write a little helper component that references the Camera, and tweaks its Camera.transparencySortAxis and Camera.transparencySortMode at runtime.

    Here's the settings on the URP Asset showing it *is* linked to the 2DRD:
    upload_2021-9-4_18-44-39.png
    And the camera also suggesting it's being used:
    upload_2021-9-4_18-46-8.png


    Am I missing something obvious? Are 2DRD transparency sort properties just broken? Or is there some other random field or asset or API I need to implement to make it work? Have other people experienced this? If so, what's your preferred workaround?
     
  2. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    94
    Hi, what version of 2021.1 are you using? This bug is already fixed from 2021.1.1.
     
  3. fmoo

    fmoo

    Joined:
    May 31, 2015
    Posts:
    15
    I have tried 2021.1.18f, 2020.3.15f2, and 2019.4.28f1 (with both LWRP and URP)
     
  4. fmoo

    fmoo

    Joined:
    May 31, 2015
    Posts:
    15
    Huh, I wonder if there's funky going on in the upgrade path or the sprite materials that's causing it to not work. I'll dig into it some more.
     
  5. fmoo

    fmoo

    Joined:
    May 31, 2015
    Posts:
    15
    Definitely not the upgrade path. I just tried a new project (started in 2D, then added Universal RP, and a couple of other approaches), and yeah, it's still only working if I remove the RP and use the graphics tab directly for some reason. I tried both creating the dedicated "Pipeline Asset (2D Renderer)" as well instead of creating the Asset + 2D Renderer Data separately.

    I've also tried switching the SpriteRenderers' materials from Sprites-Default to Sprite-Unlit-Default; that didn't seem to help either

    I've attached a really simple project from 2021.1.18f that reproduces the issue.

    Nothing
    in the UI seems to be throwing an error or suggesting why this is not working.

    It's probably something simple somewhere, but I'm just totally missing it.
     

    Attached Files:

  6. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    94
    I investigated this issue and found out that the initial fix overlooked the unlit pass. Therefore the transparency sort mode and axis isn't taken into account when there are no lights in the scene. I'll submit a fix and let you know when it is released. A workaround for now is to add a Global Light 2D in the scene.
     
  7. fmoo

    fmoo

    Joined:
    May 31, 2015
    Posts:
    15
    Dude, you are a hero! Not just swooping in with a fix for a future release, but also a workaround I can integrate trivially. Thanks so much!!