I'm trying make virtual objects be hidden when a real world object is positioned in front of it, but not having any luck with it, i've been playing with the occlusion settings in unity but the virtual objects do not become hidden?
Occlusion in AR
Asked Answered
You could fix this problem by building your augmented reality scene with the experimental meshing enabled.
Here is an example of the concept https://www.youtube.com/watch?v=sn3bhnPlfcw
You then could ray cast from camera to the virtual object and turn off the object if a mesh blocks the raycast.
+1 on AndrewNakas's solution.
Another solution is to do the screen space depth buffer test. That means taking a depth image from the point cloud Tango provides, and compare it with the virtual camera's depth buffer.
Tango Unity SDK implemented this feature on the Tango AR Camera
prefab. There's a checkbox named Enable Occlusion
.
It shouldn't be.. Did you enable depth in the TangoManager prefab? –
Steer
Yeah i have. do i need to do anything to the objects? –
Huesman
The objects sort of disappear, like parts of the object would disappear whilst the other parts remain visible. is this suppose to happen? –
Huesman
Ya, that is caused by the poor upsampling of the depth image. Because it is doing screen space depth test, we have to upsample the sparse depth point cloud to a depth image. We haven't found a very good way of upsampling it in our experiments. –
Steer
@JasonGuo I can't make it work though I added a Tango Point Cloud to the scene + I checked "Enable Occlusion" + I enabled depth detection in TangoManager... Any idea of what I might be missing? –
Mountain
© 2022 - 2024 — McMap. All rights reserved.