Version: 2021.2
光源
光源类型

光源

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

属性

光源设置

属性: 功能:
类型 The current type of light. Possible values are Directional, Point, Spot and Area. 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 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 in order 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 are not particularly 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 使用滑动条来控制阴影被推离光源的距离(定义为 0 到 2 之间的值)。这可用于避免错误的自阴影瑕疵。请参阅阴影贴图和 Bias 属性以了解更多信息。默认情况下,该值设置为 0.05。
        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 指定用于投射阴影的纹理遮罩(例如,为光源创建轮廓或图案光照)。
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) 着色器无法显示剪影或阴影。

方向光阴影

请注意,使用前向渲染时,会对带有剪影的方向光禁用阴影。在此情况下,可以编写自定义着色器来启用阴影;请参阅关于编写表面着色器的文档以了解更多详细信息。

提示

  • Spot lights with cookies can be extremely effective for creating the effect of light coming in from a window.
  • 低强度点光源有助于为场景提供深度。
  • 为了达到最大性能,请使用顶点光照 (VertexLit) 着色器。此着色器仅执行顶点光照,从而在低端显卡上提供更高的吞吐量。
光源
光源类型
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961