SCNCamera.wantsHDR 为真。然而,对 SCNCamera.exposureOffset 的任何更改在 iOS13 设备上都不可见。但它在 iOS12 上运行得很好。
if let camera = self.sceneView.pointOfView?.camera {
camera.exposureOffset = -5
}
最佳答案
你说的完全正确,如果有人想在 SceneKit 中使用 exposureOffset
实例属性,他/她需要首先激活 wantsHDR
属性:
var wantsHDR: Bool { get set }
在实际代码中,它可能如下所示:
sceneView.pointOfView!.camera!.wantsHDR = true
sceneView.pointOfView!.camera!.exposureOffset = -5
但 iOS 13 和 iOS 13 模拟器中存在错误。但是,如果禁用 allowsCameraControl
,exposureOffset 就可以正常工作。
sceneView.allowsCameraControl = false
Here's how
exposureOffset
changes from -2 to 2:
关于swift - SCNCamera.exposureOffset 在 iOS13 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59133410/