Search Unity

Question Shader Render Queue

Discussion in 'Shaders' started by denali95, Mar 11, 2023.

  1. denali95

    denali95

    Joined:
    Nov 6, 2016
    Posts:
    78
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    There are multiple ways to do this.
    1. Overlay camera. Probably the easiest to work with but can be heavier on performance
    2. Put render queue on overlay of the material on the gun (might not always work great dependant on your setup, but is fast)
    3. Use a custom shader (google 'unity urp render mesh on top of everything shader' and try some. Hard but can perform good)
    4. Use a URP render feature (possible, but never tried)
     
  3. denali95

    denali95

    Joined:
    Nov 6, 2016
    Posts:
    78
    For Render Queue on the material, I'm seeing "From Shader", "Geometry", "AlphaTest", and "Transparent" on the dropdown. Should I be seeing overlay as another option? Also, what exactly do you mean by overlaying the camera?
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Then maybe put it at a high number, queue 4000 or something
    And Google urp overlay camera
     
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    While I think @DevDunk ’s suggestions are well meaning, and would be correct in one interpretation of the issue you’re having, it’s missing the real problem.

    The shader you have on the ground isn’t properly setup. Most likely the fix is you should not be using a hand written shader and instead be using one made with Shader Graph.
     
    DevDunk likes this.