3

When I run my app containing a SCNView, containing some objects and some SCNLight (added a keylight and ambientlight), it does run correctly on real iOS devices.

However, when I try to run in iOS Simulator, the lighting does not work. When I set the scene background color, I can still see the objects as black silhouettes in the simulator.

Does anyone have an idea what causes this and is there any solution to let SCNLights work correctly on the iOS Simulator?

I already tried changing the render engine mode with various options:

defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferRendererHint X

Where X is:

0 = auto
1 = Metal
2 = OpenCL
3 = OpenGL

As mentioned here. However, this doesn't appear to make any difference (when I reset iOS simulator).

Some context:

  • Running iOS 11.1
  • It is a rather advanced app with another (separate) SceneView (an ARSCNView to be precise). Can the problem be caused because there are basically two SCNView's in the app? (they are never shown at the same time though).
jxd
  • 610
  • 6
  • 13

1 Answers1

0

Had same issue. Disabled shadows casting in the light's inspector and it light returned in the simulator.

  • Tried turning off "castsShadow" for the lights and objects in the scene. Sadly it made no difference for me.. – jxd Dec 05 '17 at 19:56
  • I just want to clarify, there are two places that you can disable the light's 'cast shawdows' option; node inspector and attribute inspector. I left the node inspector's enabled and disabled the one in the attribute inspector for my spot light and it worked. Best of luck to you. – David Bergman Dec 06 '17 at 15:31
  • A bit late, but just to clarify; my objects were generated programatically and not in the Xcode storyboard /scene editor. So I just set the properties by code. – jxd Dec 05 '19 at 16:02