Version: Unity 6.0 (6000.0)
语言 : 中文
Line Renderer Scene Tools panel reference
渲染轨迹

Line Renderer properties reference

Line settings

Property Function
Loop Enable this to connect the first and last positions of the line, and form a closed loop.
Positions The array of Vector3 points to connect.
Width Define a width value, and a curve value to control the width of your line along its length.

The curve is sampled at each vertex, so its accuracy is limited by the number of vertices in your line. The overall width of the line is controlled by the width value.
Color Define a gradient to control the color of the line along its length.

Unity samples colors from the Color gradient at each vertex. Between each vertex, Unity applies linear interpolation to colors. Adding more vertices to your line might give a closer approximation of a detailed gradient.
Corner Vertices This property dictates how many extra vertices are used when drawing corners in a line. Increase this value to make the line corners appear rounder.
End Cap Vertices This property dictates how many extra vertices are used to create end caps on the line. Increase this value to make the line caps appear rounder.
Alignment Set the direction that the line faces. The options are:
  • View: The line faces the Camera.
  • TransformZ: The line faces the Z axis of its Transform component.
Texture Mode Control how the Texture is applied to the line. The options are:
  • Stretch: Map the texture once along the entire length of the line.
  • Tile: Repeat the texture along the line, based on its length in world units. To set the tiling rate, use Material.SetTextureScale.
  • DistributePerSegment: Map the texture once along the entire length of the line, assuming all vertices are evenly spaced.
  • RepeatPerSegment: Repeat the texture along the line, repeating at a rate of once per line segment. To adjust the tiling rate, use Material.SetTextureScale.
Shadow Bias Set the amount to move shadows away from the Light to remove shadowing artifacts caused by approximating a volume with billboarded geometry.
Generate Lighting Data If enabled, Unity builds the line geometry with normals and tangents included. This allows it to use Materials that use the Scene lighting.
Use World Space If enabled, the points are considered as world space coordinates. If disabled, they are local to the transform of the__ GameObject__Unity 场景中的基础对象,可以表示角色、道具、风景、摄像机、路径点等。GameObject 的功能由所附的组件决定。更多信息
See in Glossary
to which this component is attached.

Materials

The Materials section lists all the materials that this component uses.

|Property|Description| |:—|:—| Size 材质列表中的元素数量。

如果减少元素数量,Unity 会删除列表末尾的元素。如果增加元素数量,Unity 会在列表末尾添加新元素。同时 Unity 会使用列表末尾元素所使用的材质来填充这些新元素。 Element 列表中的材质元素。您可以为每个元素分配一个材质资源。

默认情况下,Unity 会根据材质名称按字母顺序对列表进行排序。此列表是可重新排序的,当您更改元素的顺序时,Unity 会自动更新元素的编号。

Lighting

The Lighting section contains properties that relate to lighting.

|Property|Description| |:—|:—| Cast Shadows 指定当合适的光源 照射到此渲染器时,它是否以及如何投射阴影。

此属性对应于 Renderer.shadowCastingMode API。 On 当有投射阴影的光源照射到此渲染器时,它会投射阴影。 Off 此渲染器不投射阴影。 Two-sided 此渲染器投射双面阴影。这意味着单面物体(如平面或四边形)即使光源位于网格的背面,也能投射阴影。

对于支持双面阴影的烘焙全局光照或 Enlighten 实时全局光照,材质必须支持双面全局光照Shadows Only 此渲染器投射阴影,但渲染器本身不可见。 Receive Shadows 指定 Unity 是否显示投射到此渲染器上的阴影。

此属性仅在场景启用了烘焙全局光照实时全局光照 时生效。

此属性对应于 Renderer.receiveShadows API。 Contribute Global Illumination 将此渲染器纳入全局光照 (Global Illumination, GI) 的计算中,该计算在烘焙时进行。

此属性仅在场景启用了烘焙全局光照实时全局光照 时生效。

启用此属性后,将在游戏对象的静态编辑器标志 中设置 Contribute GI 标志。它对应于 StaticEditorFlags.ContributeGI API。 Receive Global Illumination 指定 Unity 是否从烘焙光照贴图或运行时光照探针向此渲染器提供全局光照数据。

此属性仅在您启用 Contribute Global Illumination 时后可编辑。此属性仅在场景启用了烘焙全局光照实时全局光照 时生效。

此属性对应于 MeshRenderer.receiveGI API。 Lightmaps Unity 从光照贴图向此渲染器提供全局光照数据。 Light Probes Unity 从场景中的光照探针 向此渲染器提供全局光照数据。 Prioritize Illumination 启用此属性可确保此渲染器始终被包含在 Enlighten 实时全局光照计算中。这使得渲染器能够受到远处发光体的影响,即使这些发光体通常因性能原因被排除在全局光照计算之外。

此属性仅在以下条件下可见:游戏对象的静态编辑器标志 中启用了 Contribute GI,项目使用内置渲染管线 (Built-in Render Pipeline),并且场景启用了实时全局光照

Probes

The Probes section contains properties relating to Light Probe and Reflection Probes.

|Property|Description| |:—|:—| Light Probes 设置此渲染器如何从光照探针 系统接收光照。

此属性对应于 Renderer.lightProbeUsage API。 Off 渲染器不使用任何插值光照探针。 Blend Probes 渲染器使用一个插值光照探针。这是默认值。 Use Proxy Volume 渲染器使用插值光照探针的 3D 网格。 Custom Provided 渲染器从材质属性块 提取光照探针着色器 uniform 值。 Proxy Volume Override 设置对另一个带有光照探针代理体积组件的游戏对象的引用。

仅当光照探针设置为使用代理体积 (Use Proxy Volume) 时,此属性才可见。 Reflection Probes 设置渲染器如何从反射探针系统接收反射。

此属性对应于 Renderer.probeAnchor API。 Off 禁用反射探针。Unity 将天空盒用于反射。 Blend Probes 启用反射探针。混合仅在反射探针之间发生。在室内环境中,如果角色可能在具有不同光照设置的区域之间过渡,此设置会很有用。 Blend Probes and Skybox 启用反射探针。混合发生在反射探针之间或反射探针与默认反射之间。这对于室外环境很有用。 Simple 启用反射探针,但存在两个重叠的探针体积时,反射探针之间不会发生混合。 Anchor Override 设置变换组件,Unity 在使用光照探针反射探针 系统时,将使用该组件来确定插值位置。默认情况下,这个位置是渲染器几何体的包围盒中心。

此属性对应于 Renderer.probeAnchor API。

Additional Settings

The Additional Settings section contains additional properties.

|Property|Description| |:—|:—| Motion Vectors 设置是否使用运动矢量来跟踪此渲染器从一帧到下一帧的每个像素的屏幕空间运动。您可以利用这些信息来实现后期处理效果,例如运动模糊。

注意:并非所有平台都支持运动矢量功能。请参阅 SystemInfo.supportsMotionVectors 以了解更多信息。

此属性对应于 Renderer.motionVectorGenerationMode API。 Camera Motion Only 仅使用摄像机移动来跟踪运动。 Per Object Motion 使用特定通道来跟踪此渲染器的运动。 Force No Motion 不跟踪运动。 Dynamic Occlusion 启用 Dynamic Occlusion 后,当一个渲染器被静态遮挡物阻挡在摄像机的视野之外时,Unity 的遮挡剔除 系统将剔除该渲染器。如果未启用 Dynamic Occlusion,即使渲染器被静态遮挡物阻挡,系统也不会将其剔除。

默认情况下启用 Dynamic Occlusion。如果需要实现如绘制墙后角色轮廓的效果,可以禁用此选项。 Sorting Layer 此渲染器的排序图层的名称。 Order in Layer 此渲染器在排序图层中的顺序。

LineRenderer

Line Renderer Scene Tools panel reference
渲染轨迹