SceneKit. How to achieve default scene light behavior without autoenablesDefaultLighting?

Viewed 18

I tried to set autoenablesDefaultLighting=true for my SCNView and it looks good. However i want to achieve the same behavior without autoenablesDefaultLighting with setting light and adjust it a little bit.

I tried omni light with this code:

let lightNode = SCNNode()
lightNode.light = SCNLight()
lightNode.light?.castsShadow = true
lightNode.light?.type = .omni
lightNode.light?.intensity = 10000
lightNode.position = SCNVector3(x: 0, y: 0, z: 100)
scene.rootNode.addChildNode(lightNode)

And got this: enter image description here

And with autoenablesDefaultLighting=true I got this:

enter image description here

0 Answers
Related