Postprocessing effects
Create special rendering effects for your RealityKit scenes.
Overview
In iOS 15 and later, and macOS 12 and later, you can apply postprocess effects to a RealityKit scene after RealityKit renders it, but before RealityKit displays it. If you register a postprocess callback function, RealityKit passes that function the complete, rendered frame so you can modify it before the viewer sees it. You can use any image processing or drawing APIs on the rendered frame but, as a practical matter, only APIs that execute on the GPU are fast enough to use every frame and maintain a good framerate.
Core Image, Metal kernal functions, Metal Performance Shaders, and SpriteKit all execute on the GPU and can be effectively used to implement postprocessing effects.
Topics
Core Image effects
Metal effects
Using Metal performance shaders to create custom postprocess effectsImplementing special rendering effects with RealityKit postprocessingChecking the pixel format of a postprocess effect’s output texturePassing Structured Data to a Metal Compute FunctionImplementing postprocess effects using Metal compute functions