Portals are visual effects allowing users to see through surfaces to another scene or reality.
In VisionOS, for now portals are created using the AR/Basic Occlusion shader included in the PolySpatial package.
Creating a Portal in VisionOS:
- Create an inward-facing cube.
- Apply the AR/Basic Occlusion shader to the cube.
- This cube acts as a mask, blocking the virtual scene and displaying the passthrough camera.
Example:
Imagine a game set in a forest. Adding a cube with the AR/Basic Occlusion shader creates a window to the real world. Entering the cube reveals the forest scene, creating a magical effect.
Limitations:
The AR/Basic Occlusion shader is a placeholder replaced by the standard AR Occlusion shader at runtime.
No vertex displacement effects are supported.
Alterations to the portal's size or shape require modifications to the cube's transform or mesh.
Compatibility:
The AR/Basic Occlusion shader functions only in VisionOS mixed reality mode.
Not compatible with fully immersive VR mode or in the editor (shows skybox or error pink).
Works in simulator and builds within an unbounded volume.
Unsupported Features:
URP Render Features and the fixed layer are not supported in VisionOS mixed reality.
The only relevant camera is the Volume Camera, impacting object visibility.
Future Developments:
A portal component is under development to simplify portal creation in VisionOS.
No ETA available for public release.
Documentation:
No official documentation for the AR/Basic Occlusion shader.
Shader behavior is similar to the ARKit shader based on internal testing.
Conclusion:
The provided workaround offers the best solution for creating portals in VisionOS until the portal component is released.
You are encouraged to experiment within the outlined limitations and stay updated on future developments.