我正在使用 ARKit 并尝试按照 Apple 示例将纹理应用于面部锚点。但是,纹理上应用了极其明亮的光。
如何降低基于physicallyBased lightingModel 创建的光的强度或颜色?
func createFaceNode(_ renderer: SCNSceneRenderer) {
guard let sceneView = renderer as? ARSCNView,
let geometry = ARSCNFaceGeometry(device: sceneView.device!),
let material = geometry.firstMaterial
else { return }
material.diffuse.contents = #imageLiteral(resourceName: "texture")
material.normal.contents = #imageLiteral(resourceName: "normal")
material.lightingModel = .physicallyBased
material.ambientOcclusion.contents = UIColor.darkGray
}