景深(Depth Of Field)
是RealityKit和SceneKit框架中的后处理渲染器功能。由于ARKit不负责渲染,因此在ARKit中没有景深
。
景深
是全新的RealityKit伴侣框架的选项之一。 ARCamera的景深通过ARView.RenderOptions
基于iOS设备功能激活和停用。如果您的设备支持,它将默认处于ON
状态。要关闭它,您需要使用disableDepthOfField
全局类型属性:
static let disableDepthOfField: ARView.RenderOptions
RealityKit文档:禁用所有虚拟内容的景深效果。
在SceneKit
框架中,虚拟相机有一个wantsDepthOfField
实例属性。
var wantsDepthOfField: Bool { get set }
let nonAR_Camera = SCNCamera()
nonAR_Camera.wantsDepthOfField = true
nonAR_Camera.focusDistance = 1.5 // distance in meters
nonAR_Camera.fStop = 4.0
注:深度-of-field blur effects 指的是“景深模糊效果”。SceneKit文档:一个布尔值,它决定了SceneKit是否为相机渲染景深模糊效果。