URP——光照

使用通用渲染管线(URP),您可以实现真实的照明,这是适合一系列的艺术风格。

所有Unity的渲染管线共享共同的照明功能,但是每个渲染管线都有一些重要的区别。

通用渲染管线(URP)不同于Unity的普通照明功能的地方是:

  • 光照组件检查器,它显示一些URP特定的控件。
  • 通用附加照明数据组件,它允许Unity存储URP的特定的光的相关数据。
  • URP不支持使用Enlighten的实时全局照明。Enlighten 已经被弃用了,而2020 LTS是最后一个支持Enlighten 功能的Unity版本。更多关于Enlighten 支持的信息,请参见Unity日志文章

对于Unity的内置渲染管道和URP的照明特性的完整比较,以及最新的照明特性列表,目前正在研究中,请看这个特性比较图表

关于Unity中照明的一般介绍和常见照明工作流程的例子,请参阅Unity手册中的照明部分。

The Light component

光线决定了物体的阴影和它投射的阴影。

这个页面包含了关于通用渲染管线(URP)中的光组件的信息。关于Unity中照明的一般介绍和常见照明工作流程的例子,请参阅Unity手册中的照明部分。

Properties

Property:Function:
Type

The current type of light. Possible values are DirectionalPointSpot and Area.

当前的光类型。可能的值是方向光、点光源、聚光灯和面积光

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

Use the color picker to set the color of the emitted light.

使用颜色选择器来设置发射光的颜色。

Mode

Specify the Light Mode used to determine if and how a light is "baked". Possible modes are RealtimeMixed and Baked.

指定用来确定是否以及如何“烘焙”一盏灯的灯光模式。可能的模式有实时模式、混合模式和烘焙模式。

Intensity

Set the brightness of the light. The default value for a Directional light is 0.5. The default value for a PointSpot or Area light is 1.

设置灯光的亮度。方向光的默认值是0.5。点光、聚光灯或区域光源的默认值是1。

Indirect Multiplier

Use this value to vary the intensity of indirect light. Indirect light is light that has bounced from one object to another. The Indirect Multiplier defines the brightness of bounced light calculated by the global illumination (GI) system. 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.

使用这个值来改变间接光的强度。间接光是从一个物体反射到另一个物体的光。间接乘法器定义了由全局照明(GI)系统计算的反弹光的亮度。如果你设置间接倍增器的值小于1,被反射的光会随着每次反射而变暗。大于1的值会在每次反弹时使光线更亮。这是有用的,例如,当黑暗的表面在阴影(如洞穴的内部)需要更亮,以使细节可见。

Shadow Type

Determine whether this Light casts Hard Shadows, Soft Shadows, or no shadows at all. See the page Lights for information on hard and soft shadows.

确定这个光是否投下了硬阴影,软阴影,或者根本没有阴影。有关硬阴影和软阴影的信息,请参阅页面灯光。

    Baked Shadow Angle

If 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 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 Shadow Type is set to Hard Shadows or Soft Shadows. Use these properties to control real-time shadow rendering settings.

当阴影类型被设置为硬阴影或软阴影时,这些属性是可用的。使用这些属性来控制实时的阴影渲染设置。

        Strength

Use the slider to control how dark the shadows cast by this Light are, represented by a value between 0 and 1. This is set to 1 by default.

使用滑块来控制由此光投射的阴影有多暗,由0到1之间的值表示。默认情况下设置为1。

        Bias

Controls whether to use shadow bias settings from the URP Asset, or whether to define custom shadow bias settings for this Light. Possible values are Use Pipeline Settings or Custom.

控制是否使用URP资源中的阴影偏置设置,或者是否为此光定义自定义阴影偏置设置。可能的值是使用管线设置或自定义。

        Depth

Controls the distance at which the shadows will be pushed away from the light. Useful for avoiding false self-shadowing artifacts. This property is visible only when Bias is set to Custom.

控制从光开始到阴影将被推开的距离。有助于避免虚假的自阴影。此属性仅在将偏差设置为自定义时可见。

        Normal

Controls the distance at which the shadow casting surfaces will be shrunk along the surface normal. Useful for avoiding false self-shadowing artifacts. This property is visible only when Bias is set to Custom.

控制阴影投射表面沿表面法线缩小的距离。有助于避免虚假的自阴影。此属性仅在将偏差设置为自定义时可见。

        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.

当渲染阴影时,使用滑块来控制近剪辑平面的值,定义为0.1到10之间的值。这个值被固定在0.1个单位或光的范围属性的1%,以较低的为准。默认情况下设置为0.2。

Render Mode

Use this drop-down to set the rendering priority of the selected Light. This can affect lighting fidelity and performance (see Performance Considerations,below).

使用这个下拉列表设置所选光的渲染优先级。这可能会影响照明的保真度和性能(参见下面的性能注意事项)。

    Auto

The rendering method is determined at run time, depending on the brightness of nearby lights and the current Quality settings.

渲染方法是在运行时确定的,取决于附近灯光的亮度和当前的质量设置。

    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

The light is always rendered in a faster, vertex/object light mode.

光线总是以更快的顶点/物体光照模式渲染。

Culling Mask

Use this to selectively exclude groups of objects from being affected by the Light. For more information, see Layers.

使用这个可以有选择地排除一组物体受到光线的影响。有关更多信息,请参见层。

Lighting Mode

你在照明窗口中选择的照明模式(Light Mode)决定了当前场景中所有混合灯光的行为。

URP支持以下照明模式:

The Universal Additional Light Data component

通用附加光数据是通用渲染管线(URP)用于内部数据存储的组件。通用附加光数据组件允许URP扩展和覆盖Unity的标准光组件的功能。

在URP中,一个有光组件的游戏对象也必须有一个通用的附加光数据组件。如果你的项目使用URP,当你创建一个Light GameObject时,Unity会自动添加通用的附加光数据组件。你不能从一个Light GameObject中移除通用附加的Light数据组件。

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值