Unity-Particle Systems

来源:互联网 发布:淘宝店主微博认证 编辑:程序博客网 时间:2024/05/16 01:13

   http://blog.csdn.net/tanmengwen/article/details/8104732

  粒子本质上是2D图象在3D空间的渲染。它们主要用于诸如烟,火,水飞沫,或树叶的装饰。一个粒子系统由三个独立的组件组成:粒子发射器粒子动画,以及粒子渲染。如果你想建一个静态粒子,你可以使用一个粒子发射器和渲染结合处理。动画的粒子会移动不同的方向的粒子和改变颜色的粒子。你还可以在粒子系统中通过脚本访问每个粒子,因此,你可以选择创建自己独特的行为方式。

粒子组件

    在Unity中,粒子系统通常用来制造烟雾,蒸气,火及其他大气的效果。粒子系统通过使用一个或两个纹理的多次绘制的操作,建立一个混乱的效果。

     在Unity中,一个典型的粒子系统是一个对象,它包含一个粒子发射器、一个粒子动画和一个粒子渲染。粒子发射器产生所有的粒子,粒子动画随着时间移动它们,粒子渲染在屏幕上绘制它们。

     如果你希望你的粒子与游戏结合,添加一个粒子对撞机组件到一个GameObject。(游戏对象)

Ellipsoid Particle Emitter  椭圆体的粒子发射器

     椭圆体的粒子发射器在一个球面范围内产生粒子。使用椭圆体的伸展刻度属性在球面范围内进行伸展(放大或缩小)。

 

Properties

Emit

发射

If enabled, the emitter will emit particles.

如勾选,发射器发射粒子

Min Size

最小尺寸

The minimum size each particle can be at the time when it is spawned.

产生粒子时的每个粒子的最小尺寸

Max Size

最大尺寸

The maximum size each particle can be at the time when it is spawned.

产生粒子时的每个粒子的最大尺寸

Min Energy

最小能量

The minimum lifetime of each particle, measured in seconds.

以秒计算,每个粒子最小生存期

Max Energy

最大能量

The maximum lifetime of each particle, measured in seconds.

以秒计算,每个粒子最大生存期

Min Emission

最小发射

The minimum number of particles that will be spawned every second.

每秒钟产生粒子的最小数量

Max Emission

最大发射

The maximum number of particles that will be spawned every second.

每秒钟产生粒子的最大数量

World Velocity

全局速度

The starting speed of particles in world space, along X, Y, and Z.

沿x,y,z轴粒子在全局空间的开始速度

Local Velocity

本地速度

The starting speed of particles along X, Y, and Z, measured in the object's orientation.

以物体的方向沿xyz轴的粒子开始速度

Rnd Velocity

随即速度

A random speed along X, Y, and Z that is added to the velocity.

沿xyz轴增量的随即速度

Emitter Velocity Scale

发射速度缩放

The amount of the emitter's speed that the particles inherit.

这个发射器速度数量继承至这些粒子(这个翻译的不明白)

Tangent Velocity

切线速度

The starting speed of particles along X, Y, and Z, across the Emitter's surface.

交叉发射器的表面,沿xyz轴的粒子开始速度

Simulate In World Space

在全局空间模拟

If enabled, the particles don't move when the emitter moves. If false, when you move the emitter, the particles follow it around.

如勾选,当发射器移动时,粒子不移动。如不勾选,当移动发射器时,粒子跟随移动。

One Shot

一次射击

If enabled, the particle numbers specified by min & max emission is spawned all at once. If disabled, the particles are generated in a long stream.

如勾选,根据指定的粒子最小与最大数立即全部产生。如不勾选,粒子生成一个长的流。

Ellipsoid

椭圆体

Scale of the sphere along X, Y, and Z that the particles are spawned inside.

粒子产生在沿xyz轴伸缩球体的内部。

Min Emitter Range

最小发射器范围

Determines an empty area in the center of the sphere - use this to make particles appear on the edge of the sphere.

在球体中心确定一个空的区域,这个区域做为粒子出现的球体边界

Details 详细说明

     椭圆体粒子发射器(EPEs)是基本发射器,当你从Components->Particles->Particle System菜单选择增加一个粒子系统到你的场景时已经包含在其中。

      粒子发射器与粒子动画师粒子渲染协同去创建,处理和显示粒子系统。在粒子正常运转之前,这三个组件必须存在于一个对象上。当粒子被发射,所有不同的速度相加形成粒子最终的速度。

Spawning Properties (粒子)产生属性

     当努力达到不同的效果时,产生粒子的属性,像大小、能量、发射和速度将给你的粒子系统独特的特性。一个小的尺寸可以模拟萤火虫或天空中的星星。一个大的尺寸可以模拟古色古香旧建筑物的尘埃。

     能量和发射将控制你的粒子在任何时间、任意数量的粒子在屏幕上显示多长的时间。例如:一个火箭有高的发射模拟烟雾,和高的能量模拟烟雾在空气中缓慢分散。

    速度将控制你的粒子如何移动。你或许想在脚本中更改速度实现有趣的效果,或则,你想模拟像风一样的恒定效果,设置你的XZ轴的速度吹走你的粒子

Simulate in World Space全局空间模拟

     如这项是禁用的,每个个体粒子的坐标(位置)总转化为相对与该发射器的相对坐标。当发射器移动,粒子将随着该发射器移动。若Simulate in World Space选项是启用的,粒子将不受到发射器变换的影响。例如,你有一个火焰溅射上升的火球,作为火球的火焰将分散并悬浮在空间更远。若Simulate in World Space项是禁用的,这些相同火焰将随着火球在屏幕上一起移动。

Emitter Velocity Scale 发射器速度缩放

这个属性仅适用于Simulate in World Space选项已启动。

    若该属性设置为1,这些粒子将在它们产生时原样继承发射器的变化。若设置为2,这些粒子将在它们产生时两倍继承发射器的变化。若设置为2,这些粒子将在它们产生时三倍继承发射器的变化,等等。

One Shot 一次射击

     在发射属性内部,一次射击发射将立即建立全部粒子、时间过后发射粒子停止。

Min Emitter Range 最小发射范围

     这个最小发射范围确定粒子产生在椭圆体内的深度。设置为0,将允许粒子在从球体的外部边缘到中心的范围内任何地方产生,设置为1,将限制在球体的边缘范围位置产生粒子。

Hints 提示

·   小心使用多的大粒子。这可能会严重妨碍低级别机器的性能。总是试着用最小粒子数目达到效果

·   发射属性总是与粒子动画的自动毁坏属性一起工作。通过脚本,你可以停止发射器发射,然后自动毁坏属性将自动销毁粒子系统和它所附加游戏对象。

 

Mesh Particle Emitter 网格粒子发射器

网格粒子发射器发射网格状的粒子。当你想让你的粒子与物体一起相互影响时是必要的从网格的表面产生粒子。

Properties 属性

Emit

发射

If enabled, the emitter will emit particles.

若启用,发射器将发射粒子

Min Size

最小尺寸

The minimum size each particle can be at the time when it is spawned.

每个粒子在产生时的最小尺寸

Max Size

最大尺寸

The maximum size each particle can be at the time when it is spawned.

每个粒子在产生时的最大尺寸

Min Energy

最小能量

The minimum lifetime of each particle, measured in seconds.

以每秒钟计,每个粒子最小生存周期

Max Energy

最大能量

The maximum lifetime of each particle, measured in seconds.

以每秒钟计,每个粒子最大生存周期

Min Emission

最小发射

The minimum number of particles that will be spawned every second.

每秒钟将产生粒子的最小数量

Max Emission

最大发射

The maximum number of particles that will be spawned every second.

每秒钟将产生粒子的最大数量

World Velocity

全局速度

The starting speed of particles in world space, along X, Y, and Z.

沿X,Y,Z轴在全局空间的开始速度

Local Velocity

局部速度

The starting speed of particles along X, Y, and Z, measured in the object's orientation.

以物体的方向沿X,Y,Z轴粒子的开始速度

Rnd Velocity

随即速度

A random speed along X, Y, and Z that is added to the velocity.

沿X,Y,Z轴随即增加的速度

Emitter Velocity Scale

发射器速度伸缩

The amount of the emitter's speed that the particles inherit.

从粒子继承的发射器的速度数量

Tangent Velocity

切线速度

The starting speed of particles along X, Y, and Z, across the Emitter's surface.

交叉通过发射器的表面沿X,Y,Z轴的粒子开始速度

Simulate In World Space

空间模拟

If enabled, the particles don't move when the emitter moves. If false, when you move the emitter, the particles follow it around.

若启用,当发射器移动,粒子不移动。若禁用,等发射器移动,粒子随着一起移动

One Shot

一次射击

If enabled, the particle numbers specified by min & max emission is spawned all at once. If disabled, the particles are generated in a long stream.

若启用,根据最小与最大属性指定的粒子数量立即产生粒子。若禁用,则产生一个粒子流

Interpolate Triangles

插入三角形

If enabled, particles are spawned all over the mesh's surface. If disabled, particles are only spawned from the mesh's vertrices.

若启用,粒子从网格表面的产生,若禁用,则只从网格的顶部产生

Systematic

系统性

If enabled, particles are spawned in the order of the vertices defined in the mesh. Although you seldom have direct control over vertex order in meshes, most 3D modelling applications have a very systematic setup when using primitives. It is important that the mesh contains no faces in order for this to work.

若启用,粒子在网管的顶部定义顺序产生,尽管你很少直接在网格顶部控制,多数的3D模型程序在使用一个系统的建立元素。重要的是这些网格包括不表面的顺序工作

Min Normal Velocity

最小正常速度

Minimum amount that particles are thrown away from the mesh.

粒子远离网格的最小数量

Max Normal Velocity
最大正常速度

Maximum amount that particles are thrown away from the mesh.

粒子远离网格的最大数量

Interpolate Triangles 插入三角形

     启动你的发射器的插入三角形将允许粒子在网格顶部产生。这个选项默认是关闭的。因此,粒子只在在顶部产生。

Systematic系统性

     开启系统性,将导致你的粒子在你的网格顶点顺序产生。顶点顺序的设置有你的3D模型程序设置。

Normal Velocity 正常速度

     正常速度控制哪个粒子从它们产生的地方沿正常发射速度来到。

     例如,建立一个网格粒子系统,使用一个立方体的网格作为发射器,启用插入三角形,设置正常最小速度与最大速度为1.你将看到粒子从立方体表面成一个直线发射。

 

Particle Animator 粒子动画

粒子动画随着时间移动你的粒子,你使用它们引用到风上,拖动你的颜色板到你的粒子系统。

Properties 属性

Does Animate Color

做动画颜色

If enabled, particles cycle their color over their lifetime.

若启用,粒子循环它们的颜色超过它们的生命周期

Color Animation

颜色动画

The 5 colors particles go through. All particles cycle over this - if some have a shorter life span than others, they will animate faster.

5种颜色粒子通过。所有粒子循环-若有一些粒子生命比其它的短,它们的动画更快。

World Rotation Axis

全局旋转轴

An optional world-space axis the particles rotate around. Use this to make advanced spell effects or give caustic bubbles some life.

粒子围绕一个可选的全局空间轴旋转。使用这个可以制造高级的魅力效果或给予一个腐蚀性的生命气泡。

Local Rotation Axis

本地旋转轴

An optional local-space axis the particles rotate around. Use this to make advanced spell effects or give caustic bubbles some life.

粒子围绕一个可选的本地空间轴旋转。使用这个可以制造高级的魅力效果或给予一个腐蚀性的生命气泡。

Size Grow

尺寸增长

Use this to make particles grow in size over their lifetime. As randomized forces will spread your particles out, it is often nice to make them grow in size so they don't fall apart. Use this to make smoke rise upwards, to simulate wind, etc.

使用这个制造粒子增长大小超过它们的生命周期。作为随即力量将向外伸展你的粒子,通常使它们很好的增长尺寸不至于使它们下落崩溃。应用这个处理烟幕的上升,模拟风等等。

Rnd Force

随即强制

A random force added to particles every frame. Use this to make smoke become more alive.

一个随即强制增加粒子每个帧。使用它处理烟雾更生动。

Force

强制

The force being applied every frame to the particles, measure relative to the world.

相对于全局的数量,强制对粒子每帧起作用

Damping

衰减

How much particles are slowed every frame. A value of 1 gives no damping, while less makes them slow down.

许多的粒子每帧变慢。在它们放慢过程中衰减值没有设为1

Auto destruct

自动销毁

If enabled, the GameObject attached to the Particle Animator will be destroyed when all particles disappear.

若启动,当所有的粒子消失时附加在动画粒子的游戏物体将销毁

Details

     粒子动画允许你的粒子系统是动态的。它们允许你更改你的粒子的颜色,应用强制和旋转,和选择当它们发射完毕销毁它们。更多的关于粒子系统的信息,参见网格粒子发射器椭球粒子发射器粒子渲染

Animating Color 动画颜色

     若你希望你的粒子更改颜色或渐显/淡出,启用它们的Animate Color并指定颜色的循环周期。任何的粒子系统使用你所选择的5种颜色进行动画颜色的循环。它们的循环速度由发射器的Energy决定

     若你想你的粒子渐显而不理解显示,设置你的第一或最后一个颜色为Alpha

Rotation Axes 旋转轴(坐标)

     无论设置本地或全局旋转坐标将导致所有产生粒子围绕坐标旋转(以Transform的中心坐标值越大进入这些坐标的粒子旋转越快。

     设置本地值将导致旋转粒子以Transform的旋转改变排列一适应本地的坐标。设置全局值将导致粒子的旋转的一致,不管以Transform的旋转。

Forces & Damping 强制与衰减

你使用强制去处理粒子加速由强制指定的方向。

衰减用于处理加速或减速而不改变它们的方向

·         A value of 1 means noDamping is applied, the particles will not slow down or accelerate.

·         值为1表示无衰减使用,这些粒子将不会减慢或加速

·         A value of 0 means particles will stop immediately.

·         设为0表示粒子将立即停止

·         A value of 2 means particles will double their speed every second.

·         设为2表示粒子将在每秒钟获得两倍的速度

Destroying GameObjects attached to Particles销毁附加粒子的游戏物体

      你可以销毁通过启用AutoDestruct属性的粒子系统和任何附加的游戏物体。例如,若你有一个油桶,你可以附加一个发射禁止和自动销毁启用的粒子系统。在碰撞时,你启动粒子发射器。当爆炸发生结束后,粒子系统和油桶将销毁并从场景中移除。

      注意当一些粒子发射后自动销毁的效果就生效。这个精确规则为:当AutoDestruct开启,物体就销毁

      如有一些粒子已经发射,但它们现在都死了或这个发射器在一些其它位置在发射,就关闭现在的发射。

 

Particle Collider 粒子碰撞

全局粒子碰撞通常用于在场景中与其它粒子碰撞。

Properties 属性

Bounce Factor

弹跳因子

Particles can be accelerated or slowed down when they collide against other objects. This factor is similar to theParticle Animator'sDamping property.

当它们与其它物体碰撞时,这些粒子可以加速或放慢速度。这一因素与Particle Animator'sDamping 属性相似

Collision Energy Loss

碰撞能量损失

Amount of energy (in seconds) a particle should lose when colliding. If the energy goes below 0, the particle is killed.

当碰撞是,这些碰撞的粒子应失去能量(以秒计),若能力低于0的粒子就被杀死

Min Kill Velocity

最小杀死速度

If a particle's Velocity drops belowMin Kill Velocity because of a collision, it will be eliminated.

若一个粒子的速度减低到最小杀死速度,因碰撞的原因,它将被淘汰

Collides with

与碰撞

Which Layers the particle will collide against.

每个阶层的俩字会相互碰撞

Send Collision Message

发送碰撞消息

If enabled, every particle sends out a collision message that you can catch through scripting.

若启用,每个粒子向外发送一个碰撞消息,你可以通过脚本抓取

Details

建立一个粒子碰撞系统:

1.     Create a Particle System usingGameObject->Create Other->Particle System

建立一个粒子系统,使用菜单游戏物体>建立其它>粒子系统

2.     Add the Particle Collider usingComponent->Particles->World Particle Collider

添加碰撞粒子,使用菜单组件>粒子>全局粒子碰撞

 

Particle Renderer 粒子渲染

粒子渲染渲染粒子系统屏幕显示


The Particle Renderer Inspector 粒子渲染检视面板

Properties 属性

Materials

材料

Reference to a list of Materials that will be displayed in the position of each individual particle.

参考材料列表,每一个粒子的位置将显示

Camera Velocity Scale

摄像机速度伸展

The amount of stretching that is applied to the Particles based onCamera movement.

在摄像机移动基础上应用于粒子的伸展数量

Stretch Particles

伸展粒子

Determines how the particles are rendered.

 

确定如何渲染粒子

Billboard

揭示栏

The particles are rendered as if facing the camera.

面对摄像机粒子渲染

Stretched

伸展

The particles are facing the direction they are moving.

面对方向移动粒子渲染

Sorted Billboard

排序揭示栏

The particles are sorted by depth. Use this when using a blending material.

粒子深度排序。当使用混合材料时使用它

Vertical Billboard

垂直揭示栏

All particles are aligned flat along the X/Z axes.

所有粒子以X/Z轴平面排列

Horizontal Billboard

垂直揭示栏

All particles are aligned flat along the X/Y axes.

所有粒子以X/Y轴平面排列

Length Scale

长度拉伸

If Stretch Particles is set toStretched, this value determines how long the particles are in their direction of motion.

若粒子拉伸设置为拉伸,则个值确定粒子在此方向上多长

Velocity Scale

速度拉伸

If Stretch Particles is set toStretched, this value determines the rate at which particles will be stretched, based on their movement speed.

若粒子拉伸设置为拉伸,该值确定在粒子拉伸速度,以它们移动速度为基础

UV Animation

紫外线动画

If either of these are set, the UV coordinates of the particles will be generated for use with a tile animated texture. See the section onAnimated Textures below.

如任一的或这些设置,紫外线与之相配的粒子将使用与动画材质一致并列产生。见下一结动画材质

X Tile

X 排列

Number of frames located across the X axis.

通过X轴定位帧的数量

Y Tile

Y 排列

Number of frames located across the Y axis.

通过Y轴定位帧的数量

Cycles

循环

How many times to loop the animation sequence.

多次循环动画序列

Choosing a Material 选择材料

当建立一个粒子渲染器非常重要的是使用适当的材料与着色。多数的时候,你想使用一个内置的材料对粒子着色。它们在Standard Assets->Particles->Sources文件夹中

建立一个新的材料非常简单:

1.     SelectAssets->Create Other->Material from the menu bar.

2.     从菜单中选择Assets->Create Other->Materia

3.     TheMaterial has a shader popup, choose one of the shaders in the Particles group. Eg.Particles->Multiply.

4.     材料着色弹出,在粒子群中选择一个着色,然后使用Particles->Multiply.

5.     Now assign a Texture. The different shaders use the alpha channel of the textures slightly differently, but most of the time a value of black will make it invisible and white in the alpha channel will display it on screen.

6.     现在分配一个纹理。同的着色器使用alpha通道的纹理略有不同,但大部分时间是将不可见的黑色和白色的alpha通道作将显示在屏幕上的值。

Distorting particles 扭曲粒子

默认情况下,粒子billboarded用渲染,这是简单的平方单色画面。对烟雾和爆炸以及其它粒子是好的效果。

粒子可以与速度一起拉伸。通常用于火花、闪电或激光束。长度和速度拉伸影响粒子延伸的长度。

排序揭示栏可以用于所有粒子深度排序。有时这是必须的。主要当使用Alpha Blended混合粒子着色。这可能是昂贵的,当真的作出质量方面的差别时渲染使用。

Animated textures 动画纹理

粒子系统可以与动画材质一起渲染。使用此功能,使用网格图像纹理处理。作为通过粒子生命周期循环,它们将通过图片循环。这是一个好的增加你的粒子生命,或处理小的部分残骸的旋转。