标签:des class http tar ext color
If you are about to lightmap your first scene in Unity, this Quickstart Guide might help you out.
如果你是在Unity第一次接触光照贴图,这个快速指南可以帮助你快速了解。
Lightmapping is fully integrated in Unity, so that you can build entire levels from within the Editor, lightmap them and have your materials automatically pick up the lightmaps without you having to worry about it. Lightmapping in Unity means that all your lights‘ properties will be mapped directly to the Beast lightmapper and baked into textures for great performance. Unity Pro extends this functionality by Global Illumination, allowing for baking realistic and beautiful lighting, that would otherwise be impossible in realtime. Additionally Unity Pro brings you sky lights and emissive materials for even more interesting scene lighting.
Unity 完全集成了光照贴图,可以通过编辑器创建完整的光照贴图,你完全不用担心,所有材质会自动获得光照贴图。光照贴图的意思是,所有灯光的特性将被直接映射到Beast lightmapper并烘培到纹理,以此获得更好的性能。UnityPro版扩展了全局光照功能,可以烘焙出真实而漂亮的光照,然相反这将不能实时。此外,Unity专业版带给你天光和发光材质,为你增加更有趣的场景照明。
In this page you will find a more in-depth description of all the attributes that you can find in the Lightmapping window. To open the Lightmapping window select Window – Lightmapping.
在此页中,你会发现更深入的描述,可以找到在Lightmapping窗口的所有属性。从菜单中Window – Lightmapping打开Lightmapping窗口。
Per-object bake settings for lights, mesh renderers and terrains - depending on the current selection.
每一个物体的烘培设置:灯光、网格渲染和地形 - 取决于当前的选择。
Mesh Renderers and Terrains 网格渲染器和地形:
Lights 灯光:
Global bake settings.
全局烘焙设置。
The editable array of all the lightmaps.
所有光照贴图的可编辑数组。
Utilities for controlling how lightmaps are displayed in the editor. Lightmap Display is a sub window of the Scene View, visible whenever the Lightmapping window is visible.
在编辑器中控制光照图如何显示的工具。光照图显示是在场景视口中的一个子窗口。可见只要光照图窗口可见。
Dual lightmaps is Unity‘s approach to make lightmapping work with specular, normal mapping and proper blending of baked and realtime shadows. It‘s also a way to make your lightmaps look good even if the lightmap resolution is low.
双光照贴图是Unity中的光照贴图可以同高光贴图,法线贴图和适当混合的实时阴影一起渲染的工具。同时它也可以让你的光照贴图看起来效果更好,即使设置的光照分辨率较低。
Dual lightmaps by default can only be used in the Deferred Lighting rendering path. In Forward rendering path, it‘s possible to enable Dual Lightmaps by writing custom shaders (use dualforward surface shader directive).
双光照贴图默认情况下只能用于延迟光照渲染路径。但通过编写自定义着色器就可能让双光照贴图用于前向渲染路径中(使用dualforward表面着色指令)。
Dual lightmaps use two sets of lightmaps:
双光照贴图即意为使用两套光照贴图:
Realtime Only lights are never baked. The Near lightmap set is used within the distance from the camera smaller than the Shadow Distance quality setting.
设置为仅实时的灯光永远不会被烘培。近端光照图作用于质量设置中的相对摄像机最小阴影距离范围内。
Within this distance Auto lights are rendered as realtime lights with specular bump and realtime shadows (this makes their shadows blend correctly with shadows from Realtime Only lights) and their indirect light is taken from the lightmap. Outside Shadow Distance Auto lights no longer render in realtime and full illumination is taken from the Far lightmap (Realtime Only lights are still there, but with disabled shadows).
在这个距离范围内,自动模式的灯光将实时渲染高光,凹凸和阴影,(它们的阴影与实时模式的等光的阴影融为一体),间接光则来自近端光照贴图。 若超出阴影距离自动模式灯光光就不再进行实时渲染,而全部照明都由光照贴图产生(仅实时模式灯光仍然产生照明,但不产生阴影)。
The scene below contains one directional light with lightmapping mode set to the default Auto, a number of static lightmapped objects (buildings, obstacles, immovable details) and some dynamic moving or movable objects (dummies with guns, barrels). The scene is baked and rendered in dual lightmaps mode: behind the shadow distance buildings are fully lit only by lightmaps, while the two dummies are dynamically lit but don‘t cast shadows anymore; in front of the shadow distance both the dummy and static lightmapped buildings and ground are lit in realtime and cast realtime shadows, but the soft indirect light comes from the near lightmap.
下面的场景包含一个默认设置为为自动模式的平行光,一些烘培完光照贴图的静态物体(建筑物,障碍物,其他静态物体)和一些动态的移动或可移动物体(持枪的假人,桶)。 该场景在双重光照贴图模式中烘焙和渲染:阴影距离以外的建筑物完全由光照贴图产生照明,而两个假人由实时灯光产生动态光照,但是不投射阴影;阴影距离范围内的建筑物和地面被即时光照亮并投下实时阴影,但柔和的间接光是来自于近端光照贴图产生。
Single Lightmaps is a much simpler technique, but it can be used in any rendering path. All static illumination (i.e. from baked only and auto lights, sky lights and emissive materials) gets baked into one set of lightmaps. These lightmaps are used on all lightmapped objects regardless of shadow distance.
单一光照贴图是非常简单的技术,但是它可以应用到任何rendering path。所有静态光照(烘培一个设置为自动模式的光源,天光和自发光(放射性)光材质。)获得一个单一通道的光照贴图。这个光照贴图可以被应用到任何可被烘培的物体而不考虑阴影距离。
To match the strength of dynamic shadows to baked shadows, you need to manually adjust the Shadow Strength property of your light:
你需要手动去修正灯光的阴影强度,使得动态阴影的强度和烘培阴影的强度相匹配:
Adjusting Shadow Strength of a light from the original value of 1.0 to 0.7.
灯光阴影强度设置从1.0修改为0.7
Unity doesn‘t require you to select special materials to use lightmaps. Any shader from the built-in shaders (and any Surface Shader you write, for that matter) already supports lightmaps out of box, without you having to worry about it - it just works.
Unity不需要你为光照贴图选择特殊的材质。大部分内置的shader(以及大部分基于这些你写的表面shader)都可以无任何限制的支持光照贴图.。因此你不必担心光照贴图渲染会出问题。
With the Resolution bake setting you control how many texels per unit are needed for your scene to look good. If there‘s a 1x1 unit plane in your scene and the resolution is set to 10 texels per unit, your plane will take up 10x10 texels in the lightmap. Resolution bake setting is a global setting. If you want to modify it for a special object (make it very small or very big in the lightmap) you can use Scale in Lightmap property of Mesh Renderers. Setting Scale in Lightmap to 0 will result in the object not being lightmapped at all (it will still influence lightmaps on other objects). Use the Lightmap Resolution scene view render mode to preview how you spend your lightmap texels.
使用分辨率烘培设置可以让你控制每世界单位烘培到多大像素范围,从而使场景看起来很漂亮。如果你的场景空间中有一个1x1大小的平面,并且设置每世界单位分配10像素。那么你将得到一张10x10像素大小的光照贴图。分辨率烘培设置是一个全局设置。如果你想编辑某些特殊的物体(使它占用光照图上非常小或者非常大的面积)你可以使用网格渲染中的缩放光照贴图属性设置。设置缩放光照图属性值为0时物体将不烘培光照贴图。(但是它依旧影响其他的可烘培物体。)。使用光照贴图分辨率场景视口渲染模式可以查看关照图分辨率。
Lightmap Resolution scene view mode visualising how the lightmap texels are spent (each square is one texel).
光照图分辨率场景查看模式可以让你看到光照图分辨率大小。(每个小方格为一像素)
A mesh that you‘re about to lightmap needs to have UVs suitable for lightmapping. The easiest way to ensure that is to enable the Generate Lightmap UVs option in Mesh Import Settings for a given mesh.
你需要烘培光照图的网格模型需要包含一个合适的光照图UVs坐标集。你可以通过开启网格导入设置中的产生光照图UVs集的选项确保万无一失。
For more information see the Lightmap UVs page.
更多信息请参考Lightmap UVs页。
The following material properties are mapped to Beast‘s internal scene representation:
下列材质属性将通过Beast的内部场景算法进行烘培处理:
Note: When mapping materials to Beast, Unity detects the ‘kind‘ of the shader by the shader‘s properties and path/name keywords such as: ‘Specular‘, ‘Transparent‘, ‘Self-Illumin‘, etc.
注:使用Best烘培材质时,Unity会通过shader的属性和路径/名称关键字如:"反射","透明"," 自发光",等等检测shader的类型。
Atlasing (UV-packing) is performed automatically every time you perform a bake and normally you don‘t have to worry about it - it just works.
Atlasing(UV包)是每次执行烘焙时都会自动执行的一个程序。
Object‘s world-space surface area is multiplied by the per-object Scale In Lightmap value and by the global Resolution and the result determines the size of the object‘s UV set (more precisely: the size of the [0,1]x[0,1] UV square) in the lightmap. Next, all objects are packed into as few lightmaps as possible, while making sure each of them occupies the amount of space calculated in the previous step. If a UV set for a given object occupies only part of the [0,1]x[0,1] square, in many cases atlasing will move neighboring UV sets closer, to make use of the empty space.
物体在世界空间表面面积是在每个物体烘培设置中的光照贴图缩放值乘以全局设置的分辨率以及物体光照贴图UV的尺寸(更确切地说是:[0,1] × [0,1]的UV平方单位)。接下来,所有的物体都压缩到 尽可能少的光照贴图里,同时确保它们的分辨率同前面我们所计算出的值一样。如果某个物体的光照图UV大小只占用了[0,1]X [0,1]平方单位的一部分,大部分情况下图集工具会减少两个物体的UV间隔,以释放更多空间。
As a result of atlasing, every object to be lightmapped has it‘s place in one of the lightmaps and that space doesn‘t overlap with any other object‘s space. The atlasing information is stored as three values: Lightmap Index, Tiling (scale) and Offset in Mesh Renderers and as one value: Lightmap Index in Terrains and can be viewed and modified via the Object pane of the lightmapping window.
由于使用了图集工具,每个将被烘培物体的光照图都有自己足够的空间,且不会与任何其他物体的光照图重叠。图集信息存储有三个值:光照贴图索引,平铺(缩放),以及在渲染网格上的偏移;地形的图集只存储为一个值:光照贴图索引,图集工具可以通过光照贴图窗口中物体面板来查看和修改。
Right-clicking a lightmap allows to select all game objects, that are using the chosen lightmap. Lightmaps of the active object from the current selection will be highlighted in yellow.
右键单击一个光照贴图,可以同时选择所有使用这张光照贴图的物体,这里我们选择的是光照贴图。如果选择某一个物体的那么它的光照贴图边框将高亮显示为黄色。
Atlasing can only modify per-object data which is Lightmap Index, Tiling and Offset and can not modify the UV set of an object, as the UV set is stored as part of the shared mesh. Lightmap UVs for a mesh can only be created at import time using Unity‘s built-in auto-unwrapper or in an external 3D package before importing to Unity.
图集工具只能修改每个对象的数据,即光照贴图索引,平铺和偏移,但不能修改物体的UV集,因为UV集是作为共享网格的一部分来存储的。一个网格物体的光照贴图 UVs只能在导入时用Unity内置的自动展开或者在三维软件中生成。
When Lock Atlas is enabled, automatic atlasing won‘t be run and Lightmap Index, Tiling and Offset on the objects won‘t be modified. Beast will rely on whatever is the current atlasing, so it‘s the user‘s responsibility to maintain correct atlasing (e.g. no overlapping objects in the lightmaps, no objects referencing a lightmap slot past the lightmap array end, etc.).
当锁定图集选项启用时,自动图集功能将无法运行,物体的光照贴图索引,平铺和偏移也不能进行修改。Beast只能依靠当前的图集,所以用户需要自己保证图集的正确性(例如:光照贴图中不能有重叠的uv,物体没有使用超出光照贴图序列范围的光照贴图索引等)。
Lock Atlas opens up the possibility for alternative workflows when sending your object‘s for lightmapping. You can then perform atlasing manually or via scripting to fit you specific needs; you can also lock the automatically generated atlasing if you are happy with the current atlasing, have baked more sets of lightmaps for your scene and want to make sure, that after adding one more object to the scene the atlasing won‘t change making the scene incompatible with other lightmap sets.
当锁定图集选项被打开时有两种分配光照贴图的工作流程可供你选择。这时可以根据你的特殊需求 手动或通过脚本来执行的图集,你也可以锁定上一次烘培时自动生成的图集,比方说你已经很满意现在的图集,或者说你需要为场景烘焙多套光照贴图, 再加入一个新物体到场景时也可以确保图集不会发生变化,不会影响到场景中已经烘培好的光照贴图。
Remember that Lock Atlas locks only atlasing, not the mesh UVs. If you change your source mesh and the mesh importer is set to generate lightmap UVs, the UVs might be generated differently and your current lightmap will look incorrectly on the object - to fix this you will need to re-bake the lightmap.
请注意锁定图集直视将图集锁定而没有将物体的UVs锁定。如果你想改变原始网格和网格导入设置中生成的UVs,那么就必须从新生成UVs,不过这样的话网格当前使用的光照贴图就不能正确的显示。如果你需要从新烘培光照贴图那么你最好修改你的设置。
If you need even more control over the bake process, see the custom Beast settings page.
如果你需要更多的烘培过程的控制,请参考custom Beast settings页面。
光照贴图深入学习 Lightmapping In-Depth,布布扣,bubuko.com
光照贴图深入学习 Lightmapping In-Depth
标签:des class http tar ext color
原文地址:http://www.cnblogs.com/chenxiaojian13/p/3806057.html