PortalComponent Clipping Behavior

Hello,

I'm experimenting with the PortalComponent and clipping behaviors. My belief was that, with some arbitrary plane mesh, I could have the entire contents of a single world entity that has a PortalCrossingComponent clipped to the boundaries of the plane mesh.

Instead, what I seem to be experiencing is that the mesh in the target world of the portal will actually display outside the plane boundaries.

I've attached a video that shows the boundaries of my world escaping the portal clipping / transition plane, and also show how, when I navigate below a certain threshold in the scene, I can see what appears to be the "clipped" world ( here, it is obvious to see the dimensions of the clipping plane ), but when I move above a certain level, it appears that the world contents "escape" the clipping behavior.

https://scale-assembly-dropbox.s3.amazonaws.com/clipping.mov

( I would have made the above a link but it is not a permitted domain - you can follow that link to see the behavior tho )

It almost seems as if "anything" with PortalCrossingComponent is allowed to appear in the PortalComponent 's parent scene, rather than being clipped by the PortalComponent 's boundary.

For reference, the code I'm using is almost identical to the sample code in this document: https://developer.apple.com/documentation/realitykit/portalcomponent

with the caveat that I'm using a plane that has .positiveY clipping and portal crossing behaviors, and the clipping plane mesh is as seen in the video.

Do I misunderstand how PortalComponent is meant to be used? Or is there a bug in how it currently behaves?

Answered by Vision Pro Engineer in 794870022

Hi, what's in the video seems like the expected behavior of portal component.

The intention for that clipping mode API is to contain entity's in the portal world that doesn't have PortalCrossingComponent within the portal bounds. This wouldn't have any effect on entities with PortalCrossingComponent. (as shown in the videos of the official documentation https://developer.apple.com/documentation/realitykit/portalcomponent)

For the behavior you described, I'd suggest implementing some additional clipping logic in your tree's material so make sure it's contained within the horizontal bounds.

Additionally I will suggest putting another plane on the backside of the portal so it doesn't look hollow when viewed from below.

Accepted Answer

Hi, what's in the video seems like the expected behavior of portal component.

The intention for that clipping mode API is to contain entity's in the portal world that doesn't have PortalCrossingComponent within the portal bounds. This wouldn't have any effect on entities with PortalCrossingComponent. (as shown in the videos of the official documentation https://developer.apple.com/documentation/realitykit/portalcomponent)

For the behavior you described, I'd suggest implementing some additional clipping logic in your tree's material so make sure it's contained within the horizontal bounds.

Additionally I will suggest putting another plane on the backside of the portal so it doesn't look hollow when viewed from below.

Thanks very much for the advice!

PortalComponent Clipping Behavior
 
 
Q