Unity Graphics (Unity 图形渲染 )
- Everything for Lighting and Rendering in Unity
- 主要涉及到光照与渲染方面的知识
本文档主要是对Unity官方教程的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
文章中涉及到的操作都是基于 Unity2018.3版本
参考链接:https://unity3d.com/cn/learn/tutorials/s/graphics
下面是将要介绍的章节,黑体是本次内容:
- Introduction to Lighting and Rendering
介绍光照和渲染 - Precomputed Realtime GI (Realtime Global Illumination)(8)
预处理实时全局光照(8) - Rendering and Shading
渲染与着色 - Cameras and Effects
相机与效果 - Geometry in Unity
几何体
6.Unwrapping and Chart reduction
展开和减少图表
Now that we have excluded suitable objects from the lighting precompute, we can begin the work of reducing the number of remaining Charts.
既然我们已经把光照预计算的合适对象用光照探头排除了,我们就可以开始减少剩余图表的数量了。
Charts are created to encompass the UV lightmap coordinates of a Static Mesh Renderer. The number of Charts that an object requires is therefore largely determined by the number of UV shells (pieces) needed to unwrap the object in question. Unwrapping is always a tradeoff between distortion of the texel distribution on geometry faces, and the number of shells required for sufficient texture coverage.
图表被创建出包围一个静态网格渲染器的UV光照图坐标。因此,一个对象需要的图表数量很大程度上问题取决于展开对象所需的UV 组(块)的数量。展开通常是在几何图形上的纹素失真和足够的组数量来完成纹理覆盖之间的折衷。
Unity’s sophisticated unwrapping algorithms will often achieve good results without our intervention; however, sometimes we need to provide a little guidance. It is therefore important that we understand the theory and process behind automatic unwrapping.
如果没有我们的干预,Unity的复杂的展开算法通常会取得不错的效果。 然而,有时我们需要提供一些指导。因此,我们必须了解自动展开背后的理论和过程。
Consider the following illustrations:
考虑下面的插图:
An unwrap without distortion, but requiring multiple UV shells.
一个没有扭曲,但需要多个UV组的展示。
UV coordinates which result in a single UV shell, but yield unacceptable texture distortion.
在一个的UV组下的UV坐标,会产生不可接受的纹理失真
An ideal result, with no texture distortion and a single UV shell.
这是一个理想的结果,没有纹理扭曲和一个的UV组。
In the images above, we show three different examples of how the UVs on an object can be projected or unwrapped.
在上面的图片中,我们展示了三个不同的例子,说明对象的UV如何进行投射或展开。
In the first image, we can see a result which is largely free of distortion. The checker pattern we are using as a texture is mapped in such a way that each tile of the texture remains square in aspect. If we imagine that this checkerboard was a lightmap (an ‘image’ of the lighting applied to the object), we would get a result that looked visually correct and without distortion. However, we require six UV shells to get this coverage. As a result, we would get six Charts using Unity’s Precomputed Realtime GI system. Regardless of the size of the object, each Chart would require a minimum of 4x4 texels, meaning that this object would use at least 96 texels irrespective of resolution.
在第一张图片中,我们可以看到一个很大程度上没有失真的结果。我们用棋盘格图案作为贴图来映射:纹理的每个tile块在每一面都是正方形。如果我们想象这个棋盘是一个光照图(一个被应用到物体上的光照的“图像”),我们就会得到一个看上去正确而不扭曲的结果。然而,我们需要6个UV组来获得覆盖。因此,我们将使用Unity的预先计算实时GI系统获得六张图表。无论对象的大小如何,每个图表都需要至少4x4的纹素,这意味着这个对象将至少使用96个纹素,而不管分辨率如何。
In the second image, we have a different problem. The object’s UV texture c