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. Dismiss Notice

Bug Render Queue not working with URP

Discussion in 'Universal Render Pipeline' started by ShavSkelet, Jul 25, 2022.

  1. ShavSkelet

    ShavSkelet

    Joined:
    Nov 29, 2017
    Posts:
    29
    I'm trying to make an object render behind everything (the stars in the sky) so I'm setting the material with the Unlit transparent shader and setting the render queue a low value (0~100) This works if the Scriptable renderer pipelines settings is set to nothing, but when i use the UniversalRP-HighQuality (Universal Render Pipeline Asset) in the Graphics settings the render queue doesnt work.
    Am I missing something on the URP Asset?

    The object's material shader is Unlit/Transparent and the render queue is set to 0. The cube object is in front of the other object.

    With the URP-High Quality asset setting the render queue below 2500 makes the object invisible
    c1.png

    But when I set the Scriptable renderer pipelines settings to none every works fine: c2.png


    Solution--------------------------------------------------------------------------------------------------------------
    I somehow managed to solve the problem but if you have a lot of materials in your project, you may not like the solution...
    I make a new shader with the shader graph (a simple one replicating the simple lit from the URP materials) applied this shader to a material and this one now has the render queue property (the simple lit from URP doesn't have it) Set the render queue from the opaque object to 3000 and the object that i want behind everything to 2502 and there you have it.

    cap.png
     
    Last edited: Jul 26, 2022
  2. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    289
    URP needs the DepthOnly Pass defined correctly in the shader for meshes drawn as opaque otherwise it does not draw depth and the skybox (which is drawn between queue id 2500 and 2501) overwrites your mesh.

    It's weird that it works for you in built-in, might just be for the scene view actually, because above should be true there as well. Anything that is drawn before the skybox and does not write depth will be drawn over with the skybox.
     
    sarahnorthway likes this.
  3. ShavSkelet

    ShavSkelet

    Joined:
    Nov 29, 2017
    Posts:
    29
    So maybe... setting the render queue of the opaque materials to something like 3000 and then setting the "behind all" material to 2502 should work?