I am having trouble getting smooth shadows in SceneKit. Below you will find the code which adds both lights to my scene, as well as a picture. I circled the areas which are pixelated.
Even the basic geometries provided by SceneKit are not being shaded correctly.
Does anyone know how I can fix this?
Thank you!
let directionalLight = SCNNode()
directionalLight.light = SCNLight()
directionalLight.light?.type = .directional
directionalLight.light?.castsShadow = true
directionalLight.eulerAngles = SCNVector3(0, -toRadians(angle: 45), -toRadians(angle: 60))
self.scene.rootNode.addChildNode(directionalLight)
let ambientLight = SCNNode()
ambientLight.light = SCNLight()
ambientLight.light?.type = .ambient
ambientLight.light?.color = UIColor.darkGray
ambientLight.light?.intensity = 5000
self.scene.rootNode.addChildNode(ambientLight)
