Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.02k stars 1.12k forks source link

[Bug] Overlay Camera (URP) does not align with AR Camera #954

Closed D33pTh0ught closed 2 years ago

D33pTh0ught commented 2 years ago

Unity bug report case number Case 1412375

Describe the bug When performing camera stacking on the ARCamera, the Overlay Camera does not align with the ARCamera.

To Reproduce Steps to reproduce the behavior:

  1. In your URP Unity Project add an Overlay Camera as child of your AR Camera.
  2. Write a script that applies the FoV of the ARCamera to the Overlay Camera.
  3. Observe that even when both Cameras render the same objects, they do not align.

Expected behavior It should be possible to align the Overlay Camera with the AR Camera the same way it does when not using ARFoundation

Actual behavior It is not possible to align the view rect of an Overlay Camera to a Camera controlled by ARFoundation

Smartphone (please complete the following information):

tdmowrer commented 2 years ago

The AR camera uses a custom projection matrix (provided by ARCore, ARKit, etc). Try copying the full projection matrix rather than just the FoV.

D33pTh0ught commented 2 years ago

Ah of course thanks, that worked!

ROBYER1 commented 12 months ago

Is there an example of the working script for this?