简体   繁体   中英

Is there a way to make a dark/low light SceneKit scene?

I've searched and there doesn't appear to be a way to make a dark SceneKit scene... As in a scene with low lighting. I've removed all lights from my scene, set my autoenablesDefaultLighting to false, made sure it's unchecked in the storyboard, I even tried adding a black ambient light but that didn't do anything. Is there a way to make a SceneKit Scene with low/dark lighting??

Had to try this for myself, as it didn't sound right. Removing all lights from the default SceneKit game template does indeed result in a model lit with an ambient light. I expect it's some kind of default that kicks into action when SceneKit identifies you have no lights in your scene.

在此输入图像描述

Adding a black ambient light doesn't seem to change this, however adding a single dark non-ambient (omni, directional, spot) does result in a dark scene. The following image is with a dark gray omni light, and no ambient light.

在此输入图像描述

I don't think this matters too much in real use, you'd be unlikely to have a scene with no non-ambient lights. Certainly understand the confusion in this instance however.

SCNLightingModelConstant is worth a look.

The SceneKit demos (code provided at apple.com) from 2014 and 2013 are quite dark. There's plenty to learn from there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM