The Mesh Renderer takes the geometry from the Mesh Filter and renders it at the position defined by the GameObject’s Transform component.
在 Inspector 窗口中显示的网格渲染器 (Mesh Renderer) 游戏对象组件
属性: | 功能: |
---|---|
Light Probes | 基于探针的光照插值模式。 |
Off | 渲染器不使用任何插值光照探针。 |
Blend Probes | 渲染器使用一个插值光照探针。这是默认选项。 |
Use Proxy Volume | 渲染器使用插值光照探针的 3D 网格。 |
Reflection Probes | Specifies how the GameObject is affected by reflections in the scene. You cannot disable this property in deferred rendering modes. |
Off | 禁用反射探针,将天空盒用于反射。 |
Blend Probes | 启用反射探针。混合仅发生在探针之间,在室内环境中非常有用。如果附近没有反射探针,则渲染器将使用默认反射,但默认反射和探针之间不会发生混合。 |
Blend Probes and Skybox | 启用反射探针。混合发生在探针之间或探针与默认反射之间,对于室外环境非常有用。 |
Simple | 启用反射探针,但当存在两个重叠的探针体积时,探针之间不会发生混合。 |
Anchor Override | 使用光照探针或反射探针系统时用变换来确定插值位置。 |
Cast Shadows | |
On | 阴影投射光源照在网格上时将投射阴影 |
Off | 网格不会投射阴影 |
Two Sided | 从网格的任一侧投射双面阴影。Enlighten 和渐进光照贴图 (Progressive Lightmapper) 不支持双面阴影。 |
Shadows Only | 网格的阴影将可见,但网格本身不可见 |
Receive Shadows | 启用此复选框可使网格显示任何投射在网格上的阴影。仅当使用渐进光照贴图时才支持 Review Shadows 选项 |
Motion Vectors | 如果启用此属性,则线会将运动矢量渲染到摄像机运动矢量纹理中。请参阅脚本 API 参考文档中的 Renderer.motionVectorGenerationMode 以了解更多信息。 |
Lightmap Static | Enable this check box to indicate to Unity that the GameObject’s location is fixed and it will participate in Global Illumination computations. If an GameObject is not marked as Lightmap Static then it can still be lit using Light Probes. |
Materials | 用于渲染模型的材质列表。 |
Dynamic Occluded | Enable this check box to indicate to Unity that occlusion culling should be performed for this GameObject even if it is not marked as static. |
Tick the lightmap static checkbox to display MeshRenderer Lightmap information in the Inspector(see also the static checkbox of the GameObject).
属性: | 功能: |
---|---|
Optimize Realtime Uvs | 指定创作的网格 UV 是否针对实时全局光照 (Realtime Global Illumination) 进行优化。启用此属性后,便会对创作的 UV 进行合并、缩放和打包以实现优化。 禁用此属性后,会对创作的 UV 进行缩放和打包,但不合并。 请注意,优化机制有时会对原始 UV 贴图中的不连续性产生误判。例如,有意锐利的边缘可能被误解为连续表面。 |
Max Distance | 指定用于简化 UV 图表的最大世界空间距离。如果图表在此距离之内,它们将被简化。 |
Max Angle | 指定共享 UV 边缘的面之间的最大角度(以度为单位)。如果面之间的角度小于此值,则将简化 UV 图表。 |
Ignore normal | 选中此复选框可防止在实时全局光照的预计算过程中拆分 UV 图表。 |
Min chart size | 指定用于 UV 图表的最小纹理像素大小。如果需要拼接,则值 4 将创建一个 4x4 纹理像素的图表来存储光照和方向性。如果不需要拼接,则值 2 将降低纹理像素密度并提供更好的光照构建时间和游戏性能。 |
属性: | 功能: |
---|---|
Scale in Lightmap | This value specifies the relative size of the GameObject’s UVs within a lightmap. A value of 0 will result in the GameObject not being lightmapped, but it will still contribute to lighting other GameObjects in the scene. A value greater than 1.0 increases the number of pixels (ie, the lightmap resolution) used for this GameObject while a value less than 1.0 decreases it. You can use this property to optimise lightmaps so that important and detailed areas are more accurately lit. For example: an isolated building with flat, dark walls will use a low lightmap scale (less than 1.0) while a collection of colourful motorcycles displayed close together warrant a high scale value. |
Prioritize illumination | Check this box to tell Unity to always include this GameObject in lighting calculations. Useful for GameObjects that are strongly emissive to make sure that other GameObjects will be illuminated by this GameObject. |
Lightmap Parameters | Allows you to choose or create a set of Lightmap Parameters for the this GameObject. |
从 3D 包导入的网格可使用多个材质。网格渲染器使用的所有材质都保存在__材质__列表中。每个子网格使用材质列表中的一个材质。如果为网格渲染器分配的材质多于网格中的子网格,则第一个子网格将用剩余的每个材质逐一渲染,一个材质加在下一个材质之上。这样就能在该子网格上设置多个渲染通道,但请注意,这可能会影响运行时的性能。另外,请注意完全不透明的材质,这种材质只是覆盖以前的层,导致性能下降却没有任何好处。
根据 Use Light Probes 和 Use Reflection Probes 选项的设置,网格可接受来自光照探针系统的光照和来自反射探针系统的反射。这两种类型的探针使用同一个点作为网格的名义位置探针插值。默认情况下,此位置点是网格包围盒的中心,但可通过将变换 (Transform) 拖动到 Anchor Override 属性来更改此值(Anchor Override 会同时影响这两种类型的探针)。
It may be useful to set the anchor in cases where a GameObject contains two adjoining Meshes; since each Mesh has a separate bounding box, the two are lit discontinuously at the join by default. However, if you set both Meshes to use the same anchor point, then they are consistently lit. By default, a probe-lit Renderer receives lighting from a single Light Probe that is interpolated from the surrounding Light Probes in the Scene. Because of this, GameObjects have constant ambient lighting across the surface. It has a rotational gradient because it is using spherical harmonics, but it lacks a spatial gradient. This is more noticeable on larger GameObjects or Particle Systems. The lighting across the GameObject matches the lighting at the anchor point, and if the GameObject straddles a lighting gradient, parts of the GameObject look incorrect.
为了缓解这种问题,请将 Light Probes 属性设置为 __Use Proxy Volume__,使用附加的光照探针代理体 (Light Probe Proxy Volume) 组件。这样就能在包围体内生成插值光照探针的 3D 网格,这种情况下的网格分辨率可由用户指定。插值光照探针的球谐函数系数会更新到 3D 纹理中;在渲染时将对这些纹理进行采样以便计算对漫射环境光照的影响。这会向探针光照游戏对象添加空间渐变。
2018–09–21 Page amended with limited editorial review
更新了双面阴影 (Two Sided shadows) 和接受阴影 (Recieve shadows) 所支持的光照后端。
在 5.6 版中更新了 Mesh Renderer UI