Search Unity

Bug Overlay Camera + GL instructions

Discussion in 'Universal Render Pipeline' started by IARA-VL, Nov 21, 2022.

  1. IARA-VL

    IARA-VL

    Joined:
    Oct 26, 2018
    Posts:
    4
    Hi,

    I swapped to URP and changed some camera to CameraRenderType.Overlay
    Some of my code is using GL.

    Code (CSharp):
    1. if (cam.tag == "MainCamera" && camUrp.renderType == CameraRenderType.Base) {
    2.      GL.Begin(GL.QUADS);
    3.  
    4.      GL.Color(colorRotation);
    5.      foreach (Vector3 quad in quads.quad1)
    6.      {
    7.          GL.Vertex(quad / 2);
    8.      }
    9.  
    10.      GL.End();
    11. }
    Problem is I was filtering it with camera tag before and now it render it in the base + overlay cameras.
    upload_2022-11-21_15-2-6.png

    If I deactivate the overlay Camera component, it does show it twice anymore so the problem is here.
    Do you have any idea on what is happening. If not, is there something else I can use to get the same result ?