光晕 (Flare) 对象是镜头光晕 (Lens Flare) 组件使用的源资源。光晕本身集合了纹理文件和确定光晕行为方式的特定信息。然后,当希望在__场景__中使用光晕时,需要从附加到__游戏对象__的 LensFlare __组件__内部引用特定光晕。
标准资源包中提供一些示例光晕。如果要将其中一个光晕添加到场景中,请将镜头光晕 (Lens Flare) 组件附加到游戏对象,然后将要使用的光晕拖动到 Lens Flare 的 Flare 属性中,操作方法就像将__材质 (Material)__ 分配给__网格渲染器 (Mesh Renderer)__ 一样。
光晕需要包含单个__纹理__上的多个光晕__元素。在光晕中,可从任何纹理选取要包含的__元素。
属性: | 功能: |
---|---|
Elements | 光晕中包含的光晕图像数量。 |
Image Index | 从 Flare Texture 为此元素使用哪个光晕图像。请参阅下面的_光晕纹理_部分以了解更多信息。 |
Position | 元素沿着从所属游戏对象的位置到屏幕中心的线路上的偏移量。0 = 游戏对象位置,1 = 屏幕中心。 |
Size | 元素的大小。 |
Color | 元素的颜色色调。 |
Use Light Color | 如果光晕附加在光源上,启用此功能会使用光源的颜色为光晕着色。 |
Rotate | 如果启用此属性,元素的底部将始终面向屏幕的中心,使元素随着镜头光晕在屏幕上移动而旋转。 |
Zoom | 如果启用此属性,元素将在可见时扩大,而在不可见时再次缩小。 |
Fade | 如果启用此属性,元素将在可见时淡入至最高强度,而在不可见时淡出。 |
Flare Texture | 此纹理包含该光晕的__元素__使用的图像。必须根据 TextureLayout 选项之一进行排列。 |
Texture Layout | 如何在__光晕纹理 (Flare Texture)__ 中布置各个光晕元素图像(有关详细信息,请参阅下面的_纹理布局_)。 |
Use Fog | 如果启用此属性,光晕将伴随着距离雾效消失。此属性通常用于小光晕。 |
光晕由多个__元素__组成,沿着一条线排列。这条线是通过比较包含镜头光晕的游戏对象的位置与屏幕的中心来计算得出的。这条线会延伸到所属游戏对象和屏幕中心之外。所有光晕__元素__都在这条线上排成一行。
出于性能原因,一个光晕的所有__元素__必须共享相同的纹理。此纹理包含一组不同的图像,这些图像可用作单个光晕中的元素。Texture Layout 定义了__元素__在__光晕纹理__中的布局。
下面提供了不同光晕__纹理布局__的选项。图像中的数字对应于每个__元素__的 Image Index 属性。
专为类似于太阳的大型光晕而设计,这种情况下需要其中一个__元素__比其他元素具有更高的保真度。此布局适用于高度是宽度两倍的纹理。
专为需要 1 个高清图像、2 个中等大小图像和 8 个小图像的复杂光晕而设计。此布局用于标准资源“50mm Zoom Flare”(50mm 缩放光晕),其中有两个中等大小的元素表示彩虹色圆圈。此布局适用于高度是宽度两倍的纹理。
单个图像。
一个简单的 2x2 网格。
一个简单的 3x3 网格。
一个简单的 4x4 网格。
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.