Version: 2023.2
光源
光源类型

光源

根据项目使用的渲染管线,Unity 在 Light Inspector 中显示不同的属性。

属性

光源设置

属性: 功能:
类型 The current type of light. Possible values are Directional, Point, Spot and Area (Rectangle or Disc light). For information on these values, see Types of Light.
Range Define how far the light emitted from the center of the object travels (Point and Spot lights only).
Spot Angle Define the angle (in degrees) at the base of a spot light’s cone (Spot light only).
Color 使用拾色器来设置发光的颜色。
Mode Specify the Light Mode. Possible modes are Realtime, Mixed and Baked. For information on these values, see Light Modes.
Intensity Set the brightness of the light. The default value for a Directional light is 0.5. The default value for a Point, Spot or Area (Rectangle or Disc)light is 1.
Indirect Multiplier Use this value to vary the intensity of indirect light. If you set Indirect Multiplier to a value lower than 1, the bounced light becomes dimmer with every bounce. A value higher than 1 makes light brighter with each bounce. This is useful, for example, when a dark surface in shadow (such as the interior of a cave) needs to be brighter to make detail visible. If you want to use Enlighten Realtime Global Illumination, but want to limit a single real-time Light so that it only emits direct light, set its Indirect Multiplier to 0.

Shadows

属性: 功能:
Shadow Type Determine whether this Light casts Hard Shadows, Soft Shadows, or no shadows at all. Hard Shadows produces shadows with a sharp edge. Hard shadows aren’t realistic compared to Soft Shadows but they involve less processing, and are acceptable for many purposes. Soft shadows also tend to reduce the “blocky” aliasing effect from the shadow map.
    Baked Shadow Angle If Mode is set to Baked or Mixed, Type is set to Directional, and Shadow Type is set to Soft Shadows, this property adds some artificial softening to the edges of shadows and gives them a more natural look.
    Baked Shadow Radius If Mode is set to Baked or Mixed, Type is set to Point or Spot ,and Shadow Type is set to Soft Shadows, this property adds some artificial softening to the edges of shadows and gives them a more natural look.
    Realtime Shadows These properties are available when Mode is set to Realtime or Mixed, and Shadow Type is set to Hard Shadows or Soft Shadows. Use these properties to control real-time shadow rendering settings.
        Strength 使用滑动条来控制此光源所投射阴影的暗度(以 0 和 1 之间的值表示)。默认情况下,此值设置为 1。
        Resolution 控制阴影贴图的渲染分辨率。较高的分辨率会增加阴影的保真度,但需要更多的 GPU 时间和内存使用量。
        Bias Use the slider to control the distance at which shadows are pushed away from the light, defined as a value between 0 and 2. This is useful for avoiding false self-shadowing artifacts. See Shadow troubleshooting for more information. This is set to 0.05 by default.
        Normal Bias 使用滑动条来控制阴影投射面沿着表面法线收缩的距离(定义为 0 到 3 之间的值)。这可用于避免错误的自阴影瑕疵。请参阅关于阴影贴图和 Bias 属性的文档以了解更多信息。默认情况下,该值设置为 0.4。
        Near Plane Use the slider to control the value for the near clip plane when rendering shadows, defined as a value between 0.1 and 10. This value is clamped to 0.1 units or 1% of the light’s Range property, whichever is lower. This is set to 0.2 by default.

其他设置

属性: 功能:
Cookie Specify a Texture mask through which shadows are cast (for example, to create silhouettes, or patterned illumination for the Light). For more information, see Cookies.
Draw Halo Tick this box to draw a spherical Halo of light with a diameter equal to the Range value. You can also use the Halo component to achieve this. Note that the Halo component is drawn in addition to the halo from the Light component, and that the Halo component’s Size parameter determines its radius, not its diameter.
Flare 如果要设置光晕在光源位置渲染,请将资源置于此字段中以用作其源。
Render Mode 使用此下拉选单来设置所选光源的渲染优先级。这会影响光照保真度和性能。
    Auto 在运行时确定渲染方法,具体取决于附近光源的亮度和当前的 Quality 设置。
    Important The light is always rendered at per-pixel quality. Use Important mode only for the most noticeable visual effects (for example, the headlights of a player’s car).
    Not Important 光源以快速、顶点/对象模式进行渲染。
Culling Mask 使用此属性可选择性排除对象组,使其不受光源影响。有关更多信息,请参阅

详细信息

If you create a Texture that contains an alpha channel and assign it to the Cookie variable of the light, the cookie is projected from the light. The cookie’s alpha mask modulates the light’s brightness, creating light and dark spots on surfaces. This is a great way to add complexity or atmosphere to a scene.

VertexLit shaders can’t display Cookies or Shadows.

方向光阴影

Note that shadows are disabled for directional lights with cookies when forward rendering is used. It’s possible to write custom shaders to enable shadows in this case; see documentation on writing surface shaders for further details.

提示

  • Spot lights with cookies can be extremely effective for creating the effect of light coming in from a window.
  • 低强度点光源有助于为场景提供深度。
  • 为了达到最大性能,请使用顶点光照 (VertexLit) 着色器。此着色器仅执行顶点光照,从而在低端显卡上提供更高的吞吐量。

Light

光源
光源类型