[Original] unity3d deep dive-Particle System)

Source: Internet
Author: User
Tags emit

Particle SystemIt is a two-dimensional image rendered in 3D controls, mainly used for smoke, fire, water drops, fallen leaves and other effects. A particle system consists of three independent parts: an example transmitter, a particle animation, and a particle Renderer.

Some particle effects are included in unity. In assets> importpackage> particles, you can set the prticles. unitypackage is imported into the project. These particle effects include: dust, fire, water, smoke, and sparkles ), there are also some particle resources sources, MISC (Miscellaneous), such

Drag a few

Next, let's talk about the old Particle System in unity3d:

Create an empty gameobject and add the five components to it.

1. ellpsoed particle: an elliptical particle transmitter that can generate a large number of particles within a planet, which can be scaled and stretched by the ellipsoid attribute.

  • Emit: particle emission. If this option is enabled, the transmitter will emit particles.
  • Min/MAX size: Minimum/large size of each particle size
  • Min/MAX energy: Minimum/large life cycle of each particle (in seconds)
  • Min/MAX emission: Minimum/large number of particles generated per second
  • World velocity: the initial velocity of a particle along the XYZ direction in the world coordinates
  • Local velocity: The local speed. It takes an object as a reference and is relative to the initial speed along the XYZ direction.
  • RND volocity: Random speed
  • Emitter velocity scale: Emission Speed Ratio
  • Tangent velocity: the tangent velocity, the initial velocity at which the particle XYZ axis passes through the surface of the transmitter.
  • Angular Velocity: angular velocity, angular velocity of new particles, unit (°/s)
  • RND angular velocity: Random Angular Velocity
  • RND rotation: random rotation. After this function is enabled, particles are generated in random directions.
  • Simulate in World Space: Updates Particle Motion in the world coordinate space. If this option is disabled, the position of each individual particle always changes with the position of the transmitter. If this option is enabled, the particle will not be affected by the motion of the transmitter. For example, when a rising fireball is generated, the flame will float upwards and be farther and farther away from the fireball. If this item is disabled, then these identical flames will move on the screen with the fireball.
  • One shot: All particles are generated at a time in the emission attribute, and then the emission is stopped. Enabling this attribute can be used for explosion, splashing, magic effect, and disabling this attribute, the smoke, wind, waterfall and other effects of the barrel.
  • Ellipsoid: elliptical, which specifies the particle generation range based on the XYZ axis.
  • Min emitter range: Minimum transmitter range

Details: The elliptical particle transmitter is the most basic particle transmitter. After being added to the scene, the boundary of a successful particle can be defined and the initial velocity of the particle can be given. Particle animation or can be used to manipulate the effects of changing particles over time.

When the image shows different particles, you can adjust the size, energy, emission, and velocity attributes respectively. For example, a small size can simulate fireflies or stars in the sky. The energy and emission attributes can control how much supertime a particle retains on the screen and how many particles can be generated at a time. The velocity attribute controls the motion of particles. You can use a script to change the value of velocity to simulate different particle effects. To simulate the wind, you can set the X and Z values of the velocity attribute.

Note:Exercise caution when using a large number of particles. The more particles, the higher the requirement on hardware devices. So try to use the least amount of particles to achieve the desired effect.

Emit attributes must be used in conjunction with the audodestruct (automatic destruction) attribute in the particle animation. A script can be used to stop the transmitter from launching particles, and the automatic destruction function will automatically destroy the Particle System and the Game objects it binds.

 

2. Mesh particle emitter: a grid particle transmitter that emits particles around a grid, starting from the surface of the grid. (Some attributes are the same as those of the elliptical particle TRANSMITTER)

  • Interpolate triangles: interpolation triangle. If this particle is enabled, it is generated on the surface of the mesh. If this particle is disabled, it is generated at the vertex of the mesh.
  • Systematic: system. particles are generated according to the vertex sequence defined by the grid.
  • Min/MAX normal velocity: Minimum/large line speed, the minimum/large number of particles thrown from the grid.
  • Mesh: mesh. You can select the mesh with a single circle button and select different grids. The initial form of particle emission varies with different grids and grids.

Details:When you need to control the position and direction of particle generation more accurately, the grid particle transmitter is simpler than the elliptical transmitter, which can be used to create more advanced effects. The mesh particle transmitter emits particles by appending vertices on the mesh. Therefore, the more dense the polygon in the mesh area, the more intensive the particle emission.

3. Particle animator: the particle animation allows the particle to move over time. You can add effects such as wind, drag and drop, and color loop to the particle system. The following describes attributes.

  • Does animation color: The color of the animation. After the animation is enabled, the color of the particle changes cyclically during its lifecycle.
  • Color Animation: Color animation that defines five colors so that all particles can use these colors cyclically.
  • World rotation axis: it is a local rotation of particles around the world coordinates and can be used to create high-order spell effects.
  • Local rotation axis: local rotation axis, where particles rotate around local coordinates.
  • Size grow: the size of a particle increases with time.
  • RND force: Random external force, each frame is randomly applied to an external force.
  • Force: an external force is applied to each frame of the particle.
  • Damping: damping. The speed of the number of particles in each frame slows down. If the value is set to 1, there is no damping, so the particle speed will not slow down.
  • Autodestruct: automatic destruction. If this option is enabled, all the disappearing particles will destroy the game objects bound to them at the same time.

Details:

Rotation axes: the rotation axis. Whether it is set to a local or global coordinate rotation axis, the particles rotate around the specified axis. The larger the value, the faster the rotation. When the rotation axis is set to local, the rotation attribute of the transform component is changed. When the rotation is set to global, the rotation axis of the particle remains unchanged.

Forces & damping: the outer force and damping. When the outer force is used, a particle accelerates in the direction. Damping allows a particle to accelerate or slow down without changing its direction. a value of 1 indicates that there is no damping, and the particle does not accelerate or slow down. A value of 0 indicates that the particle stops immediately; if the value is 2, the particle speed is doubled per second.

Destorying gameobjects attached to participant: destroys the object bound to the particle.

For example, the effect of an explosion in a bucket. You can attach a deactivated explosive particle effect to the bucket and enable the autodestruct attribute of the explosive particle. Enable the emitter attribute when a collision occurs (that is, enable the particle transmitter to play the explosion effect). After the explosion effect occurs, the barrel will be destroyed along with the lifecycle of the particle.

4. World particle collider: The world coordinate particle collision tool, which can make the particles collide with other collision bodies in the scene.

  • Bounce foctor: elasticity coefficient. When a particle collides with other objects, it accelerates or slows down. This attribute is similar to the damping (damping) attribute of the particle animation component.
  • Collision Energy Loss: the total energy loss of particles per second in the event of a collision. If it is less than 0, the particles are destroyed.
  • Collides with: collision object, which determines the level of collision between the particle and.
  • Send collision message: a collision message. When this item is enabled, each particle sends a collision message, which can be captured by a script.
  • Min kill velocity: Minimum elimination speed. If a particle decreases the speed to a minimum elimination speed due to collision, it will be destroyed.

Details:Message: Send a message. If send collision message is enabled, any particle in the collision will send the message onparticipant collision to the object bound to the particle and the object colliding with the particle.

Note:Send collision message can be used to simulate bullet and impact damage. When many particles exist, collision detection will become slow. Therefore, to use particle collision appropriately, message sending will consume a lot, therefore, try not to use it in particle systems.

 

5. Particle Renderer: the particle Renderer that renders the particles to the screen. No particle Renderer can see the effect of the particles.

  • Cast shadows: If this option is enabled, particles can produce shadows.
  • Receive shadows: This option is enabled, and particles can receive shadows.
  • MATERIALS: displays the specified material to the position of each particle. You can adjust the size parameter to add the particle type.
  • Use light probes: Use light detection. When enabled, the baked light detection can be displayed in the scene. It is an interpolation light detection.
  • Light Probe anchor.
  • Camera velocity scale: the ratio of the camera speed, applied to the total amount of extension of particles based on camera motion.
  • Stretch particle: particle stretching. This attribute determines the particle rendering method.
    • Billboard: announcement board, where particles are rendered in the direction of camera.
    • Sorted billboard: Classification announcement board. particles are classified by depth. This option is used when hybrid materials are used.
    • Stretched: stretching, where a particle is moving.
    • Horizontal billboard: horizontal announcement board with all particles aligned along the XY axis plane.
    • Vertical billboard: vertical announcement board where all particles are aligned along the plane of the xz axis.
  • Length scale: length ratio. If stretch participates is set to stretch, this value determines the length of the particle in its direction of motion.
  • Velocity scale: Speed Ratio
  • Max particle size: maximum particle size, which determines the size of the particles displayed on the screen. 1 overwrites the entire view and 0.5 overwrites half of the view.
  • UV Animation: if one of the UV animations is set, the UV coordinates of the particles are generated by tile.
    • X tile: the number of tiled rows up the X axis.
    • Y tile: the number of tiled rows up the Y axis.
    • Cycles: the number of animation sequence cycles.

Details:

1. select Material. When creating a particle Renderer, it is very important to use the appropriate material and the two-sided rendering material coloring tool, most of the time, the materials to be used have a built-in particle coloring device.

2. distorted particles. By default, the method of particle meeting billboarded is used for rendering, which will have a good effect on smoke and explosion. Particles can stretch at any speed and in any direction, which is useful for cremation, lightning, and beam effects.

3. animated textures. The particle system can be rendered using an animated tile texture. To use this function, it should be kept out of the image node. When a particle loops according to its lifecycle, it also loops along with the image. This is very useful for adding more lifecycles to particles or making small rotating fragments.

Here we will introduce the particle system. You can try an explosion effect, such as rain or snow.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.