The maximum depth difference, in units of scene space, at which to apply ambient occlusion effects.
SDKs
- iOS 11.0+
- macOS 10.13+
- Mac Catalyst 13.0+
- tvOS 11.0+
- watchOS 4.0+
Framework
- Scene
Kit
Declaration
var screenSpaceAmbientOcclusionDepthThreshold: CGFloat { get set }
Discussion
Ambient occlusion is an effect that improves material shading by calculating the amounts of ambient light that reach various parts of a surface, creating shadows on parts of a geometry where incoming light is obscured by other parts of the geometry. (You can provide pre-rendered ambient occlusion effects for a material using its ambient
property.) Screen-space ambient occlusion (SSAO) provides a real-time approximation of this effect for the entire scene viewed through the camera.
This screen
property controls the effect of relative distance from the camera on SSAO effects. Higher values create more shadowing effects between foreground and background elements of the scene, but this can result in unrealistic dark halos around foreground elements that are far from the background. Lower values avoid dark halo effects, but create less visual separation between scene elements at different distances from the camera. The default value is 0.2 units.