Search Unity

Question Get live camera feed with placed objects

Discussion in 'AR' started by Naveen_Nandanan, Apr 27, 2023.

  1. Naveen_Nandanan

    Naveen_Nandanan

    Joined:
    May 19, 2022
    Posts:
    3
    Hi, I am new to the AR Foundation. I want to get the live camera feed from ARFoundation with the placed objects in AR. I tried out a few methods, but only got the camera CPU image. I also tried with ARCameraFrameEventArgs.textures[0], but while rendering the resultant texture to a raw image, I got nothing but a white image.
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    What you are asking about here sounds to be a general-purpose solution for capturing the screen and rendering to a RawImage. AR Foundation does not have any API for this (and neither does ARCore, ARKit, etc), but you have options. If you are savvy with graphics programming, you can set up a command buffer to blit the screen to your target texture, similar to what we demonstrate here: https://docs.unity3d.com/Packages/c...mera/image-capture.html#access-images-via-gpu

    (Note however that you are trying to blit the screen in this case, not the camera background material.)

    Alternatively you could look for a third-party solution for screen recording, perhaps on the Asset Store.