how do i add a portal in visionOS?

Generated on 8/2/2024

1 search

To add a portal in visionOS, you can use the RealityKit APIs. Here are the steps to get started:

  1. Set Up the Portal Component: You need to set up the portal component and define the crossing mode. You can set the mode to a plane to enable crossing or set it to disabled to disable crossing. Ensure that the plane coincides with the portal geometry itself.

  2. Enable Portal Crossing: This feature allows objects to smoothly cross the portal surface. For example, in a game, you can have spaceships or other objects move in and out of the portal seamlessly.

  3. Lighting Configuration: When an object is inside the portal, it can be lit by a custom image-based light component. When it is outside, it receives additional lighting from an environment probe. You can use an environment lighting configuration component to control the lighting transition smoothly.

For a detailed implementation, you can refer to the session Discover RealityKit APIs for iOS, macOS and visionOS starting at 20:17.

Relevant Sessions

These sessions provide comprehensive guidance on designing and implementing portals in visionOS.

Design interactive experiences for visionOS

Design interactive experiences for visionOS

Learn how you can design a compelling interactive narrative experience for Apple Vision Pro from the designers of Encounter Dinosaurs. Discover how these types of experiences differ from existing apps, media, and games, and explore how to design narratives that bring audiences into new worlds. Find out how you can create stories that adapt to any space and size, provide multiple levels of interaction to make them accessible to all, and use animation, spatial audio, and custom gestures to further immerse people in your experience.

Platforms State of the Union

Platforms State of the Union

Discover the newest advancements on Apple platforms.

Design great visionOS apps

Design great visionOS apps

Find out how to create compelling spatial computing apps by embracing immersion, designing for eyes and hands, and taking advantage of depth, scale, and space. We’ll share several examples of great visionOS apps and explore how their designers approached creating new experiences for the platform.

Discover RealityKit APIs for iOS, macOS and visionOS

Discover RealityKit APIs for iOS, macOS and visionOS

Learn how new cross-platform APIs in RealityKit can help you build immersive apps for iOS, macOS, and visionOS. Check out the new hover effects, lights and shadows, and portal crossing features, and view them in action through real examples.

Bring your iOS or iPadOS game to visionOS

Bring your iOS or iPadOS game to visionOS

Discover how to transform your iOS or iPadOS game into a uniquely visionOS experience. Increase the immersion (and fun factor!) with a 3D frame or an immersive background. And invite players further into your world by adding depth to the window with stereoscopy or head tracking.

What’s new in device management

What’s new in device management

Learn about the latest management capabilities for iOS, iPadOS, macOS, and visionOS, then discover the latest changes to Apple Business Manager and Apple School Manager. We’ll also share updates to Activation Lock, SoftwareUpdate, and Safari management.

Get started with HealthKit in visionOS

Get started with HealthKit in visionOS

Discover how to use HealthKit to create experiences that take full advantage of the spatial canvas. Learn the capabilities of HealthKit on the platform, find out how to bring an existing iPadOS app to visionOS, and explore the special considerations governing HealthKit during a Guest User session. You’ll also learn ways to use SwiftUI, Swift Charts, and Swift concurrency to craft innovative experiences with HealthKit.