CompositorServices Or RealityKit

I have been concentrating on developing the visionOS application. While I am currently quite familiar with RealityKit, CompositorServices has also captured my attention. I have not yet acquired knowledge of CompositorServices. Could you please clarify whether it is essential for me to learn CompositorServices? Additionally, I would appreciate it if you could provide insights into the advantages of RealityKit and CompositorServices.

Answered by Vision Pro Engineer in 809310022

Hello @lijiaxu,

Is there a visual effect in your app that is not achievable with RealityKit? Understanding how to use Compositor Services is not essential to creating great looking apps on visionOS, but it certainly helps to understand the underlying tech!

RealityKit makes building apps for visionOS less complex, is great for testing out ideas quickly, and contains everything you need to create a complete experience on visionOS. But RealityKit and Compositor Services are not direct replacements for the other.

It is true that both technologies cannot be used in the same immersive space. They both provide tools for rendering content, although RealityKit provides additional tools to support physics simulations, animations, rendering content alongside objects in the real world, loading USDs and content created with Reality Composer Pro, and more.

Compositor Services allow you to draw directly with Metal APIs in a way that isn't possible with RealityKit. Check out Render Metal with passthrough in visionOS for more information. You might go this route if you have a particular stylized effect you are trying to achieve, or maybe you are writing a custom game engine and need full control over every frame. Rendering directly with Metal APIs gives you more control than is possible with RealityKit, but comes at the cost of a learning curve and the lack of the those additional features like a physics simulation.

Let me know if that helps answer your question!

Accepted Answer

Hello @lijiaxu,

Is there a visual effect in your app that is not achievable with RealityKit? Understanding how to use Compositor Services is not essential to creating great looking apps on visionOS, but it certainly helps to understand the underlying tech!

RealityKit makes building apps for visionOS less complex, is great for testing out ideas quickly, and contains everything you need to create a complete experience on visionOS. But RealityKit and Compositor Services are not direct replacements for the other.

It is true that both technologies cannot be used in the same immersive space. They both provide tools for rendering content, although RealityKit provides additional tools to support physics simulations, animations, rendering content alongside objects in the real world, loading USDs and content created with Reality Composer Pro, and more.

Compositor Services allow you to draw directly with Metal APIs in a way that isn't possible with RealityKit. Check out Render Metal with passthrough in visionOS for more information. You might go this route if you have a particular stylized effect you are trying to achieve, or maybe you are writing a custom game engine and need full control over every frame. Rendering directly with Metal APIs gives you more control than is possible with RealityKit, but comes at the cost of a learning curve and the lack of the those additional features like a physics simulation.

Let me know if that helps answer your question!

CompositorServices Or RealityKit
 
 
Q