SceneKit: how to recreate lighting from Google Poly for same OBJ file?

早过忘川 提交于 2019-11-29 11:28:59

OBJ files loaded through Model I/O use physically based lighting by default. This model has a cartoonish look and uses a lot of ambient lighting with a few specular highlights.

You should start by converting all your materials to the lambert lighting model.

Then add an ambient light to you scene. There's a lot of ambient lighting in this scene, every part of the object is lit. A color of 75% white will do.

Finally attach a directional light to the camera to highlight the polygons facing the user. A color of 50% white sounds about right.

In addition to MNuages answer, try to enable screen space ambient occlusion (on the camera). The following enables it for the current camera:

scnView.pointOfView.camera.screenSpaceAmbientOcclusionIntensity = 1.7;
scnView.pointOfView.camera.screenSpaceAmbientOcclusionNormalThreshold = 0.1;
scnView.pointOfView.camera.screenSpaceAmbientOcclusionDepthThreshold = 0.08;
scnView.pointOfView.camera.screenSpaceAmbientOcclusionBias = 0.33;
scnView.pointOfView.camera.screenSpaceAmbientOcclusionRadius = 3.0;

You will probably have to tweak the values a bit to get the for you desired results, the above is just what works for me in a certain scene.

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