RealityKit Shaders

Hi,
Previously with ARKit/ARSCNView I could use a SCNTechnique to apply a shader to my scene, but I can't find out how to do something similar in RealityKit
- Is there something like this in RealityKit? where I can apply a fragment/vertex shader to the scene

- or a way to get the rendered scene as a texture?
Kind Regards
Chris

Answered by ForumsContributor in
Accepted Answer

As of right now there is no way to apply custom shaders in RealityKit. This feature request is being tracked, however as always you can add your vote in favor of its prioritization by filing a report via Feedback Assistant.

Bobjt has answered the bulk of your question; but for getting the rendered scene as a texture this method might be what you want:


https://developer.apple.com/documentation/realitykit/arview/3255319-snapshot

Since iOS 15 / macOS 12 we can now add shaders in RealityKit 🎉

The entry point for these is GeometryModifier and SurfaceShader.

The usage of these is used in the Underwater code sample: Building an Immersive Experience with RealityKit

Now in RealityKit 2.0 you are able to create your own fragment/vertex shader via CustomMaterial and advanced techniques.

RealityKit Shaders
 
 
Q