Search Unity

Question Determine Occlusion Status

Discussion in 'AR' started by Incode, Oct 25, 2022.

  1. Incode

    Incode

    Joined:
    Apr 5, 2015
    Posts:
    78
    Is it possible to determine whether or not something is being occluded using the occlusion manager? E.g. I'm trying to only show an object if it's being partially occluded by the environment, can I leverage the
    environmentDepthConfidenceTexture somehow to check it's occlusion status?

    *Edit* For now, I've decided to solve this by using meshing to map the environment, raycasting against the resulting mesh, and doing a series of overlap spheres at the raycast hit point to determine a possible placement.
     
    Last edited: Oct 28, 2022
  2. HyungonKim

    HyungonKim

    Joined:
    Mar 11, 2018
    Posts:
    11
    If I don't have so many objects, I will use raycasting.
    If I have many objects, I will compare both the depth image from rendering and the depth texture from ARCore and determine if objects are occluded or not.