Hello! I am posting here because I think this might be a problem related to an AR script, and not with URP.
So I am trying to layer cameras with URP, but world text appears in different locations on the cameras I am trying to stack (I am trying to make a UI camera to render on top of special effects).
Result attached.
The result is when both cameras are on, you can see the difference between the two layers, which as you can imagine makes layering any cameras with any degree of accuracy near impossible because they don’t line up with each other.
I set up the UI camera as a child to the main camera, set it to overlay, added it to the main camera stack, the FoV is the same (by script), so I’m stuck on what could be making it different.
I tried going through and toggling every bool/setting, and I think I narrowed it down to AR Camera Background Script. When not enabled, the text lines up in play mode, but when enabled, the text renders in two different locations.
Any help or insight would be greatly appreciated! Thanks!
I would recommend overriding the sub camera’s projectionMatrix, rather than fov in order to ensure the cameras match. Or you could also use Camera.CopyFrom, and then set the layers etc that you want to be different after the settings have been copied.
Also, how are you ensuring the FoV is the same on both Cameras? In most cases it is updated after Start / Awake, so you may want to put your code in LateUpdate if you are not doing it there already.
And I tried both update and lateupdate for this, with the same result.
One thing I noticed is the frame of the camera is slightly different in the editor (picture attached). I’m not sure how this is possible when I am constantly setting the FoV to be the same.