Version: 2019.2
网格过滤器 (Mesh Filter)
带蒙皮的网格渲染器 (Skinned Mesh Renderer)

网格渲染器 (Mesh Renderer)

网格渲染器从网格过滤器 (Mesh Filter) 获取几何体,然后在游戏对象的变换组件所定义的位置渲染该几何体。

出现在 Inspector 窗口中的 Mesh Renderer 组件,其中已将 Receive Global Illumination 设置为 Light Probes。
出现在 Inspector 窗口中的 Mesh Renderer 组件,其中已将 Receive Global Illumination 设置为 Light Probes

本页包含以下部分:

Exposing advanced settings

The Static checkbox on the GameObject.
The Static checkbox on the GameObject.

Some properties in the Mesh Renderer component are hidden by default, until you mark the GameObject as Static. A static GameObject cannot move at run time. To expose these properties, enable the Contribute GI Static checkbox, or enable the Contribute Global Illumination checkbox in the Lighting section. You then need to make sure Receive Global Illumination is set to Lightmaps.

材质

Mesh Renderer Inspector 中的 Materials 部分列出了 Mesh Renderer 当前使用的所有材质。从 3D 建模软件导入的网格可以使用多种材质,而每个子网格使用列表中的一种__材质__。

如果网格包含的材质多于子网格中的材质,则 Unity 会使用剩余的每个__材质__逐一渲染最后一个子网格,一个材质加在下一个材质之上。这样可以在该子网格上设置多通道渲染。但是,这可能会对运行时的性能产生影响。完全不透明的__材质__会覆盖以前的层,导致性能下降却没有任何好处。

属性: 功能:
Size 指定 Mesh Renderer 中的 Materials 数量。如果减小 Materials 列表大小,Unity 会删除列表末尾的元素。
Element Mesh Renderer 中的 Materials 列表(以数字顺序排列)。第一个元素始终命名为 Element 0。

光照

Lighting 部分包含的属性用于指定此网格渲染器 (Mesh Renderer) 如何在 Unity 中与光照相互影响。

属性: 功能:
Cast Shadows 指定在合适的光源照射在网格上时网格是否以及如何投射阴影。
    On 阴影投射的光源照在网格上时,网格将投射阴影。
    Off 网格不会投射阴影。
    Two Sided The Mesh casts two-sided shadows from either side. Enlighten and the Progressive Lightmapper do not support two-sided shadows.
    Shadows Only 网格的阴影可见,但网格本身不可见。
Receive Shadows Enable this option to make the Mesh display any shadows that are cast upon it. This is only supported when using the Progressive Lightmapper.
Contribute Global Illumination Enable this checkbox to include the GameObject in Global Illumination computations. When enabled, Unity also enables the Static checkbox at the top of the GameObject’s Inspector, with the property Contribute Global Illumination enabled.

Enable this property to make the Receive Global Illumination property appear.
Receive Global Illumination If you select Lightmaps, the Lightmapping properties appear. You can only configure this option if you’ve enabled Contribute Global Illumination above.

If you do not enable Contribute Global Illumination, the GameObject registers as non-static, the Static checkbox at the top of the inspector doesn’t have a mark, and Receive Global Illumination is grayed out. The GameObject then receives Global Illumination from Light Probes.
Prioritize illumination Enable this property to always include this GameObject in lighting calculations. This is useful for affecting GameObjects that are far away from this emissive GameObject which, for performance reasons, wouldn’t normally be affected. By default this property is hidden. To expose it, enable the Static checkbox.

Lightmapping

If you have enabled the properties mentioned in the Exposing advanced settings) section, the Lightmapping section appears. If you also enable Realtime Global Illumination (menu: Window > Rendering > Lighting Settings), additional properties appear in the Lightmapping section, including UV properties, as shown here:

属性: 功能:
Scale in Lightmap 指定游戏对象的 UV 在光照贴图中的相对大小。值为 0 会使游戏对象不进行光照贴图,但仍然有助于为场景中的其他游戏对象提供光照。大于 1.0 的值会增加用于此游戏对象的像素数(光照贴图分辨率),而小于 1.0 的值会减小该像素数。

您可以使用此属性来优化光照贴图,从而更精确地为重要和高度细节化的区域提供光照。例如:一幢具有平坦黑暗墙壁的隔离建筑物将使用低光照贴图比例(小于 1.0),而一组靠近在一起显示的彩色摩托车则需要高比例值。
Stitch Seams When enabled, Enlighten identifies the pair of edges that should be stitched together and produces radiosity which is as smooth as possible across the seam. This parameter applies only to straight edges which run horizontally or vertically along chart boundaries in the atlas. This is designed to work with rectangles which are axis-aligned in UV space.
Lightmap Parameters Choose or create a set of Lightmap Parameters for this GameObject.
Optimize Realtime UVs Specify whether the authored Mesh UVs are optimized for Realtime Global Illumination or not. When enabled, Unity merges, scales and packs the authored UVs for optimization purposes.

When disabled, Unity scales and packs, but does not merge, the authored UVs.

The optimization sometimes makes mistakes about discontinuities in the original UV mapping. For example, an intentionally sharp edge may be misinterpreted as a continuous surface.
Max Distance Specify the maximum worldspace distance to be used for UV chart simplification. If charts are within this distance, Unity simplifies them.
Max Angle Specify the maximum angle in degrees between faces sharing a UV edge. If the angle between the faces is below this value, Unity simplifies the UV charts.
Ignore Normals Enable this option to prevent Unity from splitting the UV charts during the precompute process for Realtime Global Illumination lighting.
Min Chart Size Specify the minimum texel size used for a UV chart. If stitching is required, a value of 4 creates a chart of 4x4 texels to store lighting and directionality. If stitching is not required, a value of 2 reduces the texel density and provides better lighting build times and game performance.

When you’ve baked your lighting (menu: Window > Rendering > Lighting Settings > Generate Lighting ), the Inspector window shows the lightmaps in the Scene that the Renderer components use. Here, you can read relevant information about the Baked Lightmap and the Realtime Lightmap, if applicable.

进行烘焙后在场景中显示的光照贴图示例。
进行烘焙后在场景中显示的光照贴图示例。

Probes

The Probes section contains properties for Light Probes in your Scene.

属性: 功能:
Light Probes The probe-based lighting interpolation mode. A Mesh receives light from the Light Probe system depending on the value you set here. Unity uses a single point for the Mesh’s notional position probe interpolation. By default, this is the centre of the Mesh’s bounding box, but you can change this by dragging a Transform to the Anchor Override property.

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. The Ambient Lighting contains 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.

To prevent this, set the Light Probes property to Use Proxy Volume, with an additional Light Probe Proxy Volume component. This generates a 3D grid of interpolated Light Probes inside a bounding volume. You can edit the Light Probe Group grid through the Inspector window. Unity uses spherical harmonics as a memory-efficient method to store light data. Storage of light data through spherical harmonics produces coefficients that get converted into 3D Textures. Unity samples these 3D Textures at render time to compute the contribution to the diffuse ambient lighting. This adds a spatial gradient to probe-lit GameObjects.

For more information, see Light Probes.
    Off The Renderer doesn’t use any interpolated Light Probes.
    Blend Probes The Renderer uses one interpolated Light Probe. This is the default option.
    Use Proxy Volume The Renderer uses a 3D grid of interpolated Light Probes.
    Custom Provided The Renderer extracts light probe shader uniform values from the MaterialPropertyBlock.
Proxy Volume Override Set a reference to another GameObject that has a Light Probe Proxy Volume component.

This property is only visible when Light Probes is set to Use Proxy Volume.
Reflection Probes Specify how the GameObject is affected by reflections in the Scene. You cannot disable this property in deferred rendering modes.

A Mesh can receive reflections from the Reflection Probe system depending on the value you set here. Unity uses a single point for the Mesh’s notional position probe interpolation. By default, this is the center of the Mesh’s bounding box, but you can change this by dragging a Transform to the Anchor Override property.
    Off Disables Reflection probes. Unity uses a skybox for reflection.
    Blend Probes Enables Reflection probes. Blending occurs only between probes. This is useful in indoor environments where the character may transition between areas with different lighting settings. This is because to maintain realistic lighting, Unity has to blend the light data of two or more reflection probes. The Renderer uses default reflection if there are no reflection probes nearby, but no blending between default reflection and probe happens.
    Blend Probes and Skybox Enables Reflection probes. Blending occurs between probes or probes and default reflection. This is useful for outdoor environments.
    Simple Enables Reflection probes, but no blending occurs between probes when there are two overlapping volumes.
Anchor Override Set the Transform that Unity uses to determine the interpolation position when using the Light Probe or Reflection Probe systems. For example, this can help when a GameObject contains two adjoining Meshes. Since each Mesh has a separate bounding box, Unity lights the Meshes consistently at the same anchor point. Otherwise, Unity lights the area where the two join together discontinuously.

Additional Settings

The Additional Settings contain additional properties for this Mesh Renderer. |

属性: 功能:
Motion Vectors When enabled, the mesh has motion vectors rendered into the Camera motion vector Texture. For more information, see Renderer.motionVectorGenerationMode in the Scripting API reference documentation.
Dynamic Occlusion Enable this checkbox if you want Unity to perform occlusion culling for this GameObject even if it is not marked as Static.

  • 2019–11–08
网格过滤器 (Mesh Filter)
带蒙皮的网格渲染器 (Skinned Mesh Renderer)
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961