How to change color of dark spots in SceneKit?

463 views Asked by At

How to change color of the area where light doesn't reach?

By default it's black, so how can I make it white for example? I couldn't find it, if its duplicate, please let me know how to form my question in order to find correct answer!

Thank you in advance

3

There are 3 answers

0
George On

You can also set the shading mode to Constant if you don't want a node to be affected by shading (making it therefore dark):

enter image description here

0
Confused On

The "color of the are where light doesn't reach" demonstrates your problem, you have no light influencing your scene at this point. In any space/place where light doesn't reach, there is no colour, only blackness.

Here are the common ways of addressing 3D lighting:

1. Add more lights to places that create your ideal lighting

This is an artistic process, time consuming and arduous to get "just so". But it gets the best effects and the best atmosphere, generally speaking.

or...

2. Use an ambient light in your scene to light everything

When starting out, in 3D, there's so much to master that simply throwing in an ambient light and getting on with other work towards your goal is probably a good workflow. Work on artistic light last, use ambient lighting until then: https://developer.apple.com/reference/scenekit/scnlight.lighttype/1522769-ambient


Caveat: Ambient lights will likely solve your problem of the dark edges, but will also wash out a lot of your existing shadows.

0
Phi On

SCNLight has a property for changing the color of shadows. Here's a link to the page for more info. If you have any other questions, let me know, hopefully this helps.

SCNLight.shadowColor Link