本页介绍在将场景的 Lighting Mode 属性设置为 Subtractive 时,该场景中所有混合光源的行为。
在 Subtractive 光照模式下,场景中的所有混合光源都提供烘焙直接光照和间接光照。Unity 将静态游戏对象投射的阴影烘焙到光照贴图中。除了烘焙阴影外,一种方向光(称为主方向光)还为动态游戏对象提供实时阴影。
因为阴影被烘焙到光照贴图中,所以 Unity 在运行时缺少将烘焙阴影和实时阴影准确地结合在一起所需的信息。但是,Unity 提供了 Realtime Shadow Color 属性来减少光照贴图的影响,从而在烘焙阴影和实时阴影之间创建正确的混合视觉效果。还可以调整颜色来实现某种艺术风格。
Subtractive 光照模式在低端硬件上非常有用,因为低端硬件需要注重性能,并且只需要一个实时阴影投射光源。这种光照模式不会提供特别逼真的光照效果,而是更适合风格化美学,例如卡通风格。
将场景的 Lighting Mode 设置为 Subtractive 时,混合光源的行为如下。
将场景的 Lighting Mode 设置为 Subtractive 时,Unity 将在 Lighting 窗口中显示 Realtime Shadow Color 属性。Unity 将实时阴影与烘焙阴影结合在一起时将使用此颜色。更改此值可以近似于场景内间接光照的颜色,使实时阴影与烘焙阴影更好地匹配。
Unity 会自动在场景中选择强度值最高的方向光作为主方向光。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.