Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Camera Stack and AR Occlusion Manager

Discussion in 'AR' started by kidsfab, Jul 12, 2021.

  1. kidsfab

    kidsfab

    Joined:
    Oct 16, 2018
    Posts:
    19
    Hello Everyone.
    I have been fiddling, without success, with Camera Stacks in ARfoundation.
    I am trying to organise the Augmented material on a different camera stack (overlay) than the background Camera (device camera, currently set to base) WHILE keeping the AR Occlusion functionalities (human and environment ) running.
    The reason I want to do that is to be able to record the camera background and augmented material separately while still having them overlaid on screen.
    So far I have only been able to either have the Augmented material always on top (no occlusion) or the Augmented material appearing only where Humans are detected (kind of the opposite of what one normally wants).
    I clearly don't understand how AROcclusionManager, ARCameraManager and ARCameraBackground are working and being interdependent.
    Could anyone explain or point me to the correct way to tackle this problem? Thanks a lot !
     
  2. KyryloKuzyk

    KyryloKuzyk

    Joined:
    Nov 4, 2013
    Posts:
    1,128
    I'm not sure if this knowledge will help in your case, but I hope it can clarify what's happening.
    When the AROcclusionManager is enabled, ARKitBackground.shader will write to the depth buffer, and the depth buffer is shared across all cameras. If the first camera modified the depth buffer, then all subsequent cameras will be affected.