5

As this thread on the Apple forums mentions, lights on iOS 10 are now weaker and change how scenes look.

The thread suggests setting SCNDisableLinearSpaceRendering to YES, but this did not work. Put another way, using SCNDisableLinearSpaceRendering will not make your scene look the same on iOS 10 as on iOS 9 -- at least not in our testing.

We also tried:

floorNode.geometry?.firstMaterial?.lightingModel = SCNMaterial.LightingModel.blinn

Screenshots below show the difference between the same scene. Notice how the floor turns from green to yellow even though the lighting is the same.

The scene contains one directional light and one ambient light.

Files for reproducing scene: https://www.dropbox.com/sh/cg5f7hyf1oonxfu/AAAJef7LhpSxuJyUSjqfGbmca?dl=0.

Even if it did work, setting SCNDisableLinearSpaceRendering to YES seems to disable PBR.

Our app lets users customize the color of a directional light. The goal is to reproduce the same customized, lighting from an iOS 9 scene in an iOS 10 scene while taking advantage of PBR.

1) How can we ensure iOS 10 scenes look identical to iOS 8/9 scenes?

2) How can you achieve #1 while benefiting from PBR?

iOS 8/9 (run on simulator):

enter image description here

iOS 10 (run on user device):

enter image description here

Crashalot
  • 33,605
  • 61
  • 269
  • 439
  • For what it's worth, setting that property to YES makes my SceneKit game look identical to iOS 9. Maybe you're experiencing a bug or some fringe problem with that property, rather than it not doing what you need? – Nerrolken Sep 17 '16 at 08:05
  • @Nerrolken What type of lights did you use? We only have one ambient and one directional light. Maybe we set it incorrectly? You just set it from the plist? Did you do anything else? – Crashalot Sep 17 '16 at 17:31
  • Just a single Omni for me, with an Ambient that appears periodically. And yeah, I just set it in the PList, and it was back to normal. Does yours change at all when you set that property? – Nerrolken Sep 17 '16 at 20:24
  • @Nerrolken it does not change, unfortunately. it's like setting the prop to YES is a no-op. in any case, could you post as an answer? may help other readers. – Crashalot Sep 17 '16 at 22:40

2 Answers2

1

You can render your scene on iOS 10 like it is rendered on iOS 9 by changing the lighting model of its materials from SCNLightingModelPhysicallyBased to SCNLightingModelBlinn.

Example: If you have only one 3D model in your scene:

for(SCNMaterial * mt in model.geometry.materials)
    mt.lightingModelName = SCNLightingModelBlinn;

However by doing this you won't be able to take advantage of PBR. If you want to keep using PBR, then you can play with the intensity and temperature properties of SCNLight to achieve different results.

fabio914
  • 169
  • 1
  • 5
  • Thanks! Where did you read this? So you have to do this and set SCNDisableLinearSpaceRendering=YES? Note this only happens on a device. On the simulator the light looks fine on iOS 10. – Crashalot Sep 23 '16 at 06:15
  • Do you mean `mt.lightingModel`? There doesn't appear to be a `lightingModelName` property in the class docs ... – Crashalot Sep 23 '16 at 21:19
  • This `floorNode.geometry?.firstMaterial?.lightingModel = SCNMaterial.LightingModel.blinn` together with `SCNDisableLinearSpaceRendering=YES` did not work unfortunately. Will update question with scene and before/after shots if you want to try reproducing. Thanks! – Crashalot Sep 23 '16 at 22:52
0

This is a confirmed bug in Scene Kit. We filed a report in Bug Reporter under bug number 28459280. The problem is Metal always sets locksAmbientWithDiffuse to true on iOS 10.

According to one of the Scene Kit engineers, a workaround is to manually set locksAmbientWithDiffuse to true for the nodes in question (in this example, the floor node) then adjust the lighting on iOS 8/9 until the desired appearance is achieved.

This should ensure iOS 10 scenes look the same as iOS 8/9 scenes.

Crashalot
  • 33,605
  • 61
  • 269
  • 439