Search Unity

How can I not have custom shader/material rendering in front of "screen space - camera" canvas?

Discussion in 'General Graphics' started by seloran, Feb 28, 2021.

  1. seloran

    seloran

    Joined:
    Mar 8, 2020
    Posts:
    42
    I customized a new unlit shader by changing the color output by frag, added "Blend SrcAlpha OneMinusSrcAlpha" under Pass and "Queue" = "Transparent" under Tags.

    The effect looks good when I attached the shader/material to a sprite renderer or a quad, but in both cases, they would seem to render in front of any "screen space - camera" canvas no matter what Order in Layer I set in them and the canvas.

    Does this problem have to do with the Render Queue in the material, or is it likely due to something else?

    Edit: "Solved" the issue by setting the sprite renderer z position to be higher than 90 which is the fixed z position of the "screen space - camera" canvas.
     
    Last edited: Feb 28, 2021
    maxkcy likes this.
  2. maxkcy

    maxkcy

    Joined:
    Oct 11, 2021
    Posts:
    62
    Thank you for the solution. It worked for me.