简体   繁体   English

在SceneKit中做什么烘焙

[英]what does bake do in SceneKit

What is the purpose of "bake" option in SceneKit editor. SceneKit编辑器中“烘焙”选项的目的是什么? Does it have an impact on performance? 它对性能有影响吗? 在此输入图像描述

Type offers 2 options: Ambient Occlusion and Light Map Type提供2个选项:Ambient Occlusion和Light Map

Destination offers: Texture and Vertex 目的地提供:纹理和顶点

For me, it crashes Xcode. 对我来说,它崩溃了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. 奇怪的是Scene Kit有一个烘烤按钮。 It has never worked for me, always crashing Xcode. 它从来没有为我工作,总是崩溃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. 但事实是......要从烘焙中获得最大收益,你需要成为一名3D艺术家,在这种情况下,你会更倾向于在3D设计应用中进行烘焙。

And 3D design apps have lighting solutions that are orders of magnitude better than the best Scene Kit lighting possible. 3D设计应用程序的照明解决方案比最佳场景套件照明要好几个数量级。 I can't imagine that there's really a need for baking in Scene Kit. 我无法想象在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. 对于开发团队而言,花时间进行是一件奇怪的事情,因为它甚至无法接近即使是最便宜的3D设计应用程序所提供的质量。

What I remember from college days: Baking is actually process in 3D rendering and textures. 从大学时代开始我记得:烘焙实际上是3D渲染和纹理的过程。 You have two kind of bakings: texture baking and physics baking. 你有两种bakings:纹理烘焙和物理烘焙。

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. 例如,您在Rigid Body中使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM