Version: 2021.2
光源模式:Realtime
光源模式:Baked

光源模式:Mixed

本页介绍将 Light 组件的 Mode 属性设置为 Mixed 时该组件的行为。这类光源称为混合光源。

Mixed Lights combine elements of both real-time and baked lighting. You can use Mixed Lights to combine dynamic shadows with baked lighting from the same light source, or when you want a light to contribute direct real-time lighting and baked indirect lighting.

要使用混合光源,必须首先了解实时光源烘焙光源的优势和局限性。

混合光源行为

  • 场景中所有混合光源的行为取决于 Lighting 窗口中的 Lighting Mode 设置。不同的光照模式具有非常不同的性能特征和不同级别的视觉保真度。有关更多信息,请参阅光照模式
  • 可在运行时更改混合光源的属性。这样做将更新光源的实时光照,但不会更新烘焙光照。进行此操作时,请注意避免不必要的视觉效果。

混合光源的局限性

  • The performance cost of Mixed Lights differs considerably, depending on the Lighting Mode. However, because Mixed Lights always combine at least some real-time and some baked lighting, Mixed Lights always involve more runtime calculations than fully baked lighting, and higher memory usage than fully real-time lighting.

请注意,如果在场景中禁用了 Baked Global Illumination,Unity 会强制使混合光源表现得就像已将其 Mode 设置为 Realtime 一样。发生这种情况时,Unity 将在 Light 组件的 Inspector 中显示警告。

光源模式:Realtime
光源模式:Baked