Camera zoom effect in ARFoundation

How can I achieve a zoom-in effect with the ARCamera in ARFoundation?

Changing the FOV doesn’t work, I assume ARFoundation is overriding the camera’s transform matrix for tracking purposes.

In a previous VR application I managed to achieve something similar by changing Unity - Scripting API: XR.XRDevice.fovZoomFactor, but this doesn’t seem to work either.

Any pointers?

Yes, the camera’s projection matrix is controlled by ARFoundation, which gets it from the platform (e.g., ARCore or ARKit). Changing the FOV would cause all AR content to appear in the wrong place, so we’ve not provided a way to do that.

Can you elaborate on your use case?

Just want to simulate the effect of ‘zooming / diving inside’ the AR content once the user clicks a specific element of it.

I did think of some other ‘dirty’ ways to do so, I could just scale the content up (although as the camera background stays the same it might look weird) or blit the screen to a texture and scale it up - I wanted to check if there was a cleaner way of achieving this.

I think your analysis is correct – there’s no direct support for this in ARFoundation, but rending to a render texture and scaling that seems like a reasonable approach to me.

Gotcha, thanks for your prompt support!

am working on the project where the normal camera and arfoundation camera has difference …in arcamera is slightly zoomed …how can i get the view as in native camera …is there any possiblity to change arcamera config?
1st image is mobile camera …while 2nd is arcamera from arfoundation …i need like normal camera view …any help ?

This probably isn’t possible. Unity gets the cam feed from ARCore, so you should go to google ARCore pages for support

1 Like