Reduce Application Lag while using shadows in SceneKit

不打扰是莪最后的温柔 提交于 2019-12-13 02:15:50

问题


I am working on a 3D map in SceneKit. When I enable the Cast Shadow Property of a directional light in SceneKit, the shadows appear, but the application becomes very slow.

How do I reduce the lag while still maintaining shadows in the scene?


回答1:


Use Fake Shadows (shadows generated and baked as a texture in 3D authoring tool) rather than True Shadow Map. To apply fake shadows as a texture for 3D plane use PNG file format with premultiplied alpha channel (RGB * A).

It helps you get rid of (or considerably reduce) application lag while using shadows in SceneKit or ARKit.

To see how it works just download a sample application from here: Handling 3D Interaction and UI Controls in Augmented Reality.



来源:https://stackoverflow.com/questions/51070521/reduce-application-lag-while-using-shadows-in-scenekit

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