what does bake do in SceneKit

旧时模样 提交于 2019-12-23 12:07:26

问题


What is the purpose of "bake" option in SceneKit editor. Does it have an impact on performance?

Type offers 2 options: Ambient Occlusion and Light Map

Destination offers: Texture and Vertex


回答1:


For me, it crashes Xcode. It's supposed to render lighting (specifically shadows) into the textures on objects so you don't need static lights.

This should, theoretically, mean that all you need in your scene are the lights used to create dynamic lighting on objects that move, and you can save all the calculations required to fill the scene with static lights on static geometry.

In terms of performance, yes, baking in the lighting can create a HUGE jump in performance because it's saving you all the complex calculations that create ambient light, occlusion and direct shadows and soft shadows.

If you're using ambient occlusion and soft shadows in real-time you'll be seeing VERY low frame rates.

And the quality possible with baking is far beyond what you can achieve with a super computer in real time, particularly in terms of global illumination.

What's odd is that Scene Kit has a bake button. It has never worked for me, always crashing Xcode. But the thing is... to get the most from baking, you need to be a 3D artist, in which case you'll be much more inclined to do the baking in a 3D design app.

And 3D design apps have lighting solutions that are orders of magnitude better than the best Scene Kit lighting possible. I can't imagine that there's really a need for baking in Scene Kit. It's a strange thing for the development team to have spent time on as it simply could never come close to the quality afforded by even the cheapest 3D design app.




回答2:


What I remember from college days: Baking is actually process in 3D rendering and textures. You have two kind of bakings: texture baking and physics baking.

Texture baking: You calculate some data and save that data to a texture. You use that on your material. With that, you reduce rendering time. Every single frame, everything is calculated again and again. If you have animations, that is a lot of time wasted there.

Physics baking: You can pre calculate physics simulations exactly like above baking and you use that data. For example you use it in Rigid Body.



来源:https://stackoverflow.com/questions/33568786/what-does-bake-do-in-scenekit

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