光照贴图接缝缝合技术可在使用烘焙光照贴图渲染的游戏对象中平滑不需要的硬边缘。
接缝缝合与渐进光照贴图 (Progressive Lightmapper) 配合来实现光照贴图烘焙。接缝缝合仅对单个游戏对象有效;多个游戏对象无法平滑地缝合在一起。
光照贴图要求 Unity 将 3D 游戏对象展开到平面光照贴图上。在光照贴图空间中,Unity 将靠近在一起但彼此分开的网格面识别为单独个体;这些网格的边缘称为“接缝”。理想情况下,应该看不见接缝,但根据光源的不同,它们有时看起来有硬边缘。这是因为 GPU 无法在光照贴图中分开的图表之间混合纹理像素值。
接缝缝合方法便可以解决这些问题。启用接缝缝合后,Unity 会执行额外计算来修改光照贴图,从而改善每个接缝的外观。缝合方法并不完美,但通常会极大改善最终结果。默认情况下,Unity 会禁用接缝缝合,这是因为 Unity 需要进行额外计算,导致烘焙期间接缝缝合要花费额外时间。您可以在游戏对象的网格渲染器 (MeshRenderer) 上启用缝合。
要在游戏对象上启用接缝缝合,请找到游戏对象的网格渲染器 (Mesh Renderer) 组件,打开 Lightmap Settings 部分(仅当使用渐进光照贴图时才能访问),然后勾选 Stitch Seams。
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.