SceneKit:如何在iOS 10上重现iOS 9灯光色彩效果(单向,一个环境)而不禁用PBR? [英] SceneKit: how to reproduce iOS 9 lighting color effect (one directional, one ambient) on iOS 10 without disabling PBR?

查看:277
本文介绍了SceneKit:如何在iOS 10上重现iOS 9灯光色彩效果(单向,一个环境)而不禁用PBR?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Apple论坛上提到



iOS 10(在用户设备上运行):



解决方案

这是Scene Kit中已确认的错误。我们在Bug Reporter中提交了一个错误号为28459280的报告。问题是Metal总是在iOS 10上将 locksAmbientWithDiffuse 设置为 true



根据Scene Kit工程师之一的说法,解决方法是手动将 locksAmbientWithDiffuse 设置为<$ c $对于有问题的节点(在此示例中为楼层节点),c> true 然后在iOS 8/9上调整光照,直到达到所需的外观。



这应该确保iOS 10场景看起来与iOS 8/9场景相同。


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):

iOS 10 (run on user device):

解决方案

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.

这篇关于SceneKit:如何在iOS 10上重现iOS 9灯光色彩效果(单向,一个环境)而不禁用PBR?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆