Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Transparency ordering not working with shader graph

Discussion in 'Graphics for ECS' started by gamedevlope0, Dec 14, 2022.

  1. gamedevlope0

    gamedevlope0

    Joined:
    Jul 5, 2022
    Posts:
    2
    Using Unity 2022.2.0f1

    When creating a new URP Shader graph (for both Lit and Unlit) and setting the surface type to Transparent, the transparency ordering for entities seems broken.
    However, the builtin URP/Lit shader works as expected.
    I may be missing something, but cant for the life of me figure out why the shader graph acts differently compared to the built in shader.

    Recreated in the TransparencyOrdering sample from
    https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/HybridURPSamples
    Actual result (using a very basic lit URP shader graph, set to transparent, instead of URP/Lit):
    upload_2022-12-14_20-57-7.png
    upload_2022-12-14_20-57-43.png
    Expected (no changes to sample, using the builtin URP/Lit shader):
    upload_2022-12-14_20-55-51.png
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,299
    Check the Material is set to Transparent. The Shader Graph settings are often overwritten by the Material Settings. It is very annoying.
     
    gamedevlope0 likes this.
  3. gamedevlope0

    gamedevlope0

    Joined:
    Jul 5, 2022
    Posts:
    2
    These material settings? Setting the Queue control to UserOverride and the RenderQueue to Transparent didnt seem to make a difference.
    upload_2022-12-14_21-25-53.png
    This made no difference.
    upload_2022-12-14_21-28-17.png

    Oh and also, they are flickering a lot, like somehow they get rendered in a different order each frame? Not quite sure on that.
     
  4. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,299
    Sorry. I was thinking about HDRP. In HDRP, the "Surface Options" are populated with the "Surface Type", "Double-Sided", ect.
     
    gamedevlope0 likes this.
  5. Botaurus

    Botaurus

    Joined:
    Feb 20, 2013
    Posts:
    81
    having the same issue
     
  6. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    352
    I can confirm that this seems to be a bug.

    As a workaround, you should be able to place the
    DepthSorted_Tag
    component on transparent entities manually, which should fix the rendering. This is supposed to happen automatically, but it seems that there is a bug in the current version.
     
    Chmyke, trader_j0e and Fribur like this.