粒子渲染器__负责在屏幕上渲染__粒子系统。
属性: | 功能: | ||
---|---|---|---|
Cast Shadows | 如果启用此属性,则允许网格投射阴影。 | ||
Receive Shadows | 如果启用此属性,则允许网格接受阴影。 | ||
Motion Vectors | 如果启用此属性,则线会将运动矢量渲染到摄像机运动矢量纹理中。请参阅脚本 API 参考文档中的 Renderer.motionVectors 以了解更多信息。 | ||
Materials | 引用显示在每个单独粒子位置的__材质__列表。 | ||
Light Probes | 基于探针的光照插值模式。 | ||
Reflection Probes | 如果启用此属性,并且场景中存在反射探针,则会为此粒子渲染器拾取反射纹理,并将此纹理设置为内置的着色器 uniform 变量。 | ||
Probe Anchor | 如果定义了此属性(使用游戏对象),渲染器将使用此游戏对象的位置来查找插值光照探针。 | ||
Camera Velocity Scale | 根据摄像机移动而应用于粒子的拉伸量。 | ||
Stretch Particles | 确定粒子的渲染方式: | ||
Billboard | 粒子渲染为面向摄像机。 | ||
Stretched | 粒子面向它们移动的方向。 | ||
SortedBillboard | 粒子按深度排序。使用混合材质时选用此选项。 | ||
VerticalBillboard | 所有粒子沿 X/Z 轴平齐排列。 | ||
HorizontalBillboard | 所有粒子沿 X/Y 轴平齐排列。 | ||
Length Scale | 如果 Stretch Particles 设置为 Stretched__,则此值确定粒子在其运动方向上的移动距离。 | |Velocity Scale__ | 如果 Stretch Particles 设置为 Stretched__,则此值根据粒子的移动速度确定粒子拉伸的速率。 | |UV Animation__ | 如果定义了 X 和/或 Y,则会生成粒子的 UV 坐标以用于区块动画纹理。请参阅下面的动画纹理。 |
X Tile | 横跨 X 轴的帧数。 | ||
Y Tile | 横跨 Y 轴的帧数。 | ||
Cycles | 动画序列的循环次数。 |
任何粒子系统都需要粒子渲染器才能在屏幕上显示。
设置粒子渲染器时,使用适当的材质和用于渲染材质两面的着色器非常重要。Unity 建议将粒子着色器与粒子渲染器结合使用;大多数情况下,只需将材质与其中一个内置粒子着色器一起使用即可。Standard Assets > Particles > Sources 文件夹中提供了一些预先制作的材质供您使用。
创建新材质的过程很简单:
请注意,不同的着色器使用纹理 Alpha 通道的方式略有不同,但大多数情况下,Alpha 通道中的黑色值使其不可见,而白色值则使其显示在屏幕上。
默认情况下,粒子渲染为公告牌(即,简单的方形精灵)。这对于烟雾、爆炸和大多数其他粒子效果非常有用。请参阅公告牌渲染器 (Billboard Renderer) 以了解更多信息。
可使粒子随速度拉伸。Length Scale 和 Velocity Scale 会影响拉伸粒子的长度。这对于火花、闪电或激光束等效果非常有用。
Sorted Billboard 可用于使所有粒子按深度排序。有时这是必要的,主要是在使用 Alpha 混合 (Alpha Blended) 粒子着色器时。此功能可能需要大量资源并影响性能;只有在渲染时能带来显著质量提升时才应使用。
可使用动画区块纹理来渲染粒子系统。要使用此功能,请将纹理从一组图像中分离出来。当粒子经历自身的生命周期时,它们将循环显示图像。此功能适用于为粒子增添更多动态性,或制作小的旋转碎片。
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.