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

网格渲染器 (Mesh Renderer)

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

The Mesh Renderer component as it appears in the Inspector window.


属性: 功能:
Materials All the Materials used by a Mesh Renderer. Meshes imported from 3D packages can use multiple Materials. Meshes imported from 3D packages can use multiple Materials and each sub-Mesh uses one Material from the list.

If there are more Materials than there are sub-Meshes in the Mesh, Unity renders the last sub-Mesh with each of the remaining Materials, one on top of the next. This allows you to set up multi-pass rendering on that sub-Mesh. However, this can impact the performance at runtime. Also note that fully opaque Materials overwrite the previous layers, causing a decrease in performance with no advantage.
Light Probes Probe-based lighting interpolation mode. A Mesh can receive light from the Light Probe system depending on the value you set here. Unity uses a single point as 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. 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.

To alleviate this behavior, 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 where the resolution of the grid can be user-specified. The spherical harmonics coefficients of the interpolated Light Probes are updated into 3D Textures, which are sampled 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 渲染器不使用任何插值光照探针。
    Blend Probes 渲染器使用一个插值光照探针。这是默认选项。
    Use Proxy Volume 渲染器使用插值光照探针的 3D 网格。
    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 if 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 as 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.
    Off 禁用反射探针,将天空盒用于反射。
    Blend Probes 启用反射探针。混合仅发生在探针之间,在室内环境中非常有用。如果附近没有反射探针,则渲染器将使用默认反射,但默认反射和探针之间不会发生混合。
    Blend Probes and Skybox 启用反射探针。混合发生在探针之间或探针与默认反射之间,对于室外环境非常有用。
    Simple 启用反射探针,但当存在两个重叠的探针体积时,探针之间不会发生混合。
Anchor Override Set the Transform used 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.
Cast Shadows 指定在合适的光源照射在网格上时网格是否以及如何投射阴影。
    On The Mesh casts a shadow when a shadow-casting Light shines on it
    Off The Mesh does not cast shadows
    Two Sided The Mesh casts two-sided shadows from either side. Neither Enlighten nor Progressive Lightmapper supports two-sided shadows.
    Shadows Only Shadows from the Mesh are visible, but not the Mesh itself
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.
Motion Vectors If enabled, the line has motion vectors rendered into the Camera motion vector Texture. For more information, see Renderer.motionVectorGenerationMode in the Scripting API reference documentation.
Lightmap Static Enable this option to mark the GameObject’s location as fixed and that it participates in Global Illumination computations. If a GameObject is not marked as Lightmap Static then Unity can still light it using Light Probes.

When this property is enabled, the lightmap-specific properties appear. For more information, see Lightmap settings below.
Dynamic Occluded Enable this option if you want Unity to perform occlusion culling for this GameObject even if it is not marked as static.

Lightmap settings

Enable the Lightmap Static option on the Mesh Renderer component to display the Lightmap properties in the Inspector:

Alternatively, you can enable the static checkbox of the GameObject:

属性: 功能:
Scale in Lightmap Specify the relative size of the GameObject’s UVs within a lightmap. A value of 0 results in the GameObject not being lightmapped, but it still contributes to lighting other GameObjects in the Scene. A value greater than 1.0 increases the number of pixels (the lightmap resolution) used for this GameObject, while a value less than 1.0 decreases it.

You can use this property to optimize lightmaps so that important and detailed areas are more accurately lit. For example, an isolated building with flat, dark walls uses a low lightmap scale (less than 1.0) while a collection of colourful motorcycles displayed close together requires a high scale value.
Prioritize illumination Enable this option to always include this GameObject in lighting calculations. This is useful for GameObjects that are strongly emissive to make sure that other GameObjects will be illuminated by this GameObject.
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 允许为此游戏对象选择或创建一组光照贴图参数
Realtime UVs
Optimize 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.

Note that the optimization can 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.
Lightmaps Stores the lightmaps in the Scene that the Renderer components use. This makes it possible to use the same Material on multiple objects, while each object can refer to a different lightmap or different portion of the same lightmap.

  • 2019–05–30 页面已修订并只进行了有限的编辑审查

  • Updated supported lighting backends for Two Sided shadows and Receive shadows.

  • 在 5.6 版中更新了 Mesh Renderer UI

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