This an introductory description of lightmapping in Unity. For more advanced topics see in-depth description of lightmapping in Unityhtml
这是一个Unity 光照贴图的引导手册。若是想查看更多的高级功能请查看in-depth description of lightmapping in Unity。app
Unity has a built-in lightmapper: it's Beast by Illuminate Labs. Lightmapping is fully integrated in Unity. This means that Beast will bake lightmaps for your scene based on how your scene is set up within Unity, taking into account meshes, materials, textures and lights. It also means that lightmapping is now an integral part of the rendering engine - once your lightmaps are created you don't need to do anything else, they will be automatically picked up by the objects.编辑器
Unity内置的光照贴图烘培工具是Illuminate Labs 的Beast。烘培光照贴图流程被完美的整合到Unity中。这就意味着使用Beast能够根据你的网格物体,材质贴图和灯光属性的设置来烘培你的场景,从而获得完美的光照贴图。同时也意味着光照图将做为渲染引擎的一部分。只要你烘培一次光照贴图你就不须要其余任何操做。光照图将自动指定到物体上。ide
Selecting Window – Lightmapping from the menu will open the Lightmapping window:工具
从菜单栏选择Window – Lightmapping打开光照图工具窗口。ui
Scene and game views will update - your scene is now lightmapped!this
场景和游戏窗口将会更新。如今在你的场景中已经能够看到光照贴图效果了!spa
Final look of your scene depends a lot on your lighting setup and bake settings. Let's take a look at an example of some basic settings that can improve lighting quality.orm
最终场景的渲染效果取决与你对灯光和烘培选项的更多设置。让咱们来看一个经过基础设置改进光照的质量的小例子。htm
This is a basic scene with a couple of cubes and one point light in the centre. The light is casting hard shadows and the effect is quite dull and artificial.
这是一个简单的场景,包含一组立方体和一个位于场景中心的点光源。灯光产生硬阴影,看起来效果至关平淡而不天然。
Selecting the light and opening the Object pane of the Lightmapping window exposes Shadow Radius and Shadow Samples properties. Setting Shadow Radius to 1.2, Shadow Samples to 100 and re-baking produces soft shadows with wide penumbra - our image already looks much better.
选择灯光打开物体面板,展开阴影范围和阴影采样属性。设置阴影范围为1.2,阴影采样为100从新烘培,会产生一个半影范围很宽的软阴影。咱们画面看起来真的好多了。
With Unity Pro we can take the scene one step further by enabling Global Illumination and adding a Sky Light. In the Bake pane we set the number of Bounces to 1 and the Sky Light Intensity to 0.5. The result is much softer lighting with subtle diffuse interreflection effects (color bleeding from the green and blue cubes) - much nicer and it's still only 3 cubes and a light!
使用专业版Unity可以开启全局光照和天光进行烘培画面效果能获得更大的改进。在Bake(烘培)面板设置Bounces(反弹)为1,Sky Light Intensity天光强度为0.5。可以烘培出带有微妙变化的反射效果的软光源。(会从绿色和蓝色的盒子上产生色彩溢出)。
For more information about the various lightmapping-related settings, please refer to the in-depth description of lightmapping in Unity.
更多的和光照贴图设置有关的信息请查阅in-depth description of lightmapping in Unity。