Question related to graphics occluder. How to hide part of an occluder?

Hey everyone!

I’m working on an AR app where I use dynamically loaded geometry as occluders to represent the surrounding environment. The geometry is loaded at runtime through an API, so I’m not in control of it and can’t modify it directly or use boolean operations to remove the parts I don’t want.

This setup works fine when I place a new object in an empty spot (between occluder objects), but if I want to place it in place of an occluder, I need to hide part of the occluder first. My plan is to enclose the section I want to hide inside an object to “disable” it (starting with a box, but eventually I’ll need more complex shapes).

I’ve tried stencils, but they occlude everything in front and behind the object. I’ve also explored SDF box shaders, but those limit me to simple shapes like boxes and I couldn’t get it to work as expected.

In the attached screenshot, the black shapes represent the loaded context geometry that serve as occluder, the white box is the area I’d like to hide (the white box itself should not be visible, but hide the objects inside it), and the sphere is the new object I’d like to place. Has anyone tackled a similar problem?

Any advice or suggestions would be greatly appreciated!

Thanks

Hello @christophe_unity ,

Could you be more specific about what aspect of an AR session, and AR occlusion you have questions about? Your post seems to talk mostly about graphics system related Occluders.

Within an AR session, some devices and providers support AR foundation occlusion:
https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@6.0/manual/features/occlusion.html

and that works through the use of passthrough image depth being used within shaders to occlude Unity scene geometry that is present in the AR session space when rendering the scene, and does that occlusion at a per-pixel level.

Your post speaks of dynamically loaded geometry serving as occluders for occluding scene geometry if I understand correctly. If you do have AR foundation related questions about AR occlusion, we’d like to try to answer those. However, graphics system Occluder questions are better served by the graphics forums.

Hi @mike-copley-unity,

I thought I had posted in the graphics section (while tagging AR foundation in order to hopefullly get feedback from someone who ran into that same issue)

I know it’s likely a really dumb question but I don’t understand how to post directly in the graphics section. When I’m in it and try to create a new topic, I can’t seem to have the graphics option available.

I also can’t find a way to move my post to the graphics section

hi @christophe_unity ,

With this new discussion forum system, it is a matter of tags. It has been tagged for graphics so those in the graphics forum should see your post. My recommendation would be to remove the “AR” from the title and give it a more appropriate title such as “Question related to dynamic Graphics Occluders”

1 Like