How to dim the light in the view rendered by Camera in Scene Kit or ARkit?

447 Views Asked by At

I am using ARKit with SceneKit and I want to achieve an effect like the one shown in the video pasted below. I have tried all the properties like saturation, contrast etc of camera but cannot achieve the effect like this.

https://youtu.be/C16I_VxHboc

This effect is achieved when the user pans on the screen from left to right. Please suggest a way to do this with the iOS Camera(SCNCamera).

Thanks in advance.

1

There are 1 best solutions below

0
On

You can add a UIView than stretches the entire screen and give it backgroundColor of black with alpha 0 then when you want to add the dimming you can change the alpha of the view with animation.

UIView.animate(withDuration: 1, animations: { 
   self.view.alpha = 1       
})