Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to handle occlusions in Unity

Discussion in 'AR' started by luca-venturini98, Sep 14, 2023.

  1. luca-venturini98


    Jul 12, 2023
    I am developing an application in which the user is inside a room. I have the perfect 3d model of the room and the objects inside in it.
    I would like to display virtual elements, but, at the same time, if the virtual hologram is partially covered by an object in my 3d map(for example a table) just the visible part must be shown.
    My idea is to make the room 3d model transparent (so that is is not seen by the user) and all the parts of the virtual elements behind the 3d transparent model mustn't be shown.
    How can I handle it?

    I have tried exploiting the render queue, setting different values for the queue, it works if I use the standard pipeline for all my virtual holograms, however some of my holograms are built using the URP (Universal Render Pipeline) and the render queue seems not to be accessible.
    Is there a workaround? Where can I find a tutorial on this?

    NOTE: I am using the standard Unity, and I would like to avoid complex packages like AR foundations if possible.

  2. andyb-unity


    Unity Technologies

    Feb 10, 2022
    FYI this forum is moderated by the AR Foundation team. If you would like to avoid AR Foundation for your project, then I would recommend posting in another forum.