Search Unity

ARFoundation: Scaling entire screen

Discussion in 'Handheld AR' started by AndyLangberg, Feb 20, 2019.

  1. AndyLangberg

    AndyLangberg

    Joined:
    Jul 6, 2018
    Posts:
    36
    I've gotten a request from my customer to let them be able to "zoom" the screen. Since zooming only the content (Which is meant to be placed on a table next to a physical object) would look weird, I translate the request as wanting to be able to zoom in with the camera itself. Is there any readily available solution to this in arfoundation? Changing the fov does nothing on the ipad, and every other solution for zooming only scales the content, not the real world itself.
     
  2. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    518
    To "zoom" the camera image, you'd need to crop the texture and then stretch it to fit the screen. There's no easy way to do that, but you could look into writing your own background renderer. In the
    ARFoundationBackgroundRenderer
    ,
    EnableARBackgroundRendering()
    is where we setup the background texture blit. You can subclass the background renderer and override that method to manipulate the camera texture.

    That is potentially a bit of work though. You might want to clarify your customer's request to ensure that is really what they want before going that route.
     
    AndyLangberg likes this.