SceneKit: how to reproduce iOS 9 lighting color effect (one directional, one ambient) on iOS 10 without disabling PBR?

大兔子大兔子 提交于 2019-12-05 10:14:14

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!