I am currently learning to do a few things ARKit in Unity and Swift.
Does anybody how can I adapt the light of my object to the environment light?
Thanks you!
I am currently learning to do a few things ARKit in Unity and Swift.
Does anybody how can I adapt the light of my object to the environment light?
Thanks you!
To enable ARKit's
Light Estimationuse this code:
Enable Light Estimation in viewDidLoad() method:
configuration.lightEstimationEnabled = true
Exploit lightEstimate.ambientIntensity to update lighting:
func renderer(_ renderer: SCNSceneRenderer,
updateAtTime time: TimeInterval) {
guard let lightEstimate = sceneView.session.currentFrame?.lightEstimate
else {
return
}
spotLight.intensity = lightEstimate.ambientIntensity
}
Also, you can read THIS STORY.