Note that this guide was originally created for use with the Built-in Render Pipeline in Unity 2017.3. For information on adapting this guide for use with the Universal Render Pipeline (URP) and the High Definition Render Pipeline (HDRP), see Update: believable visuals in URP and HDRP.
对于室内和局部光照,请注意以下几点:
实时局部光照最主要的是聚光灯和点光源。从根本上说,这两种类型的光源都是从空间中的一个点发光并具有有限的范围。聚光灯还具有额外的角度限制。有关更多信息,请参阅光源类型文档。
聚光灯和点光源之间的主要区别在于它们如何投射阴影以及如何与剪影相互作用。使用点光源投射阴影需要 6 个阴影贴图,而聚光灯只需要一个。因此,点光源对性能的影响要高得多,应谨慎使用它们。请注意,烘焙光源不需要阴影贴图。
另一个区别是聚光灯的剪影纹理是简单的 2D 纹理,而点光源需要立方体贴图(通常在 3D 建模应用程序中制作)。有关更多信息,请参阅剪影文档。
__注意__:除非使用 HD 可编程渲染管线,否则只能在烘焙光照时使用区域光照。在 HD SRP 模式下可以实时渲染区域光源。
在选择室内光照强度时,尽可能确保室内光照强度不高于太阳光。示例场景设置在隧道中,因此天花板上不太可能有任何高强度的光源超出太阳光亮度:
为光源选择正确的颜色时,请考虑所选颜色和值的影响。选择颜色时,尽量不要完全忽视任何一个颜色通道。否则会产生很难与白色点光源会聚的光。例如,虽然左下图中的光照颜色从技术上讲是一种有效的光照颜色,但会从最终输出中删除所有蓝色:
尽量不要限制场景中的最终调色板,特别是您希望稍后进行颜色分级的情况下。
__注意__:有关使用色调映射器来处理高强度颜色值(如彩色光或火焰)的建议,请参阅高强度颜色。
在 Unity 中,如果启用了__实时 GI(全局光照)__或__烘焙__光照,发光材质可能影响光照,带来区域光照效果。如果启用了__实时 GI__,这尤其有用。假设已经提前完成预计算的情况下,您可以修改发光表面的强度和颜色并立即获得反馈。
有关更多信息,请参阅发光 (Emission)。
此时,您应该已经充分了解如何设置并照亮场景以使其看起来可信。
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.