Unity3d 5 Official Tutorial: Particle systems

Source: Internet
Author: User

In a 3D game, most of the characters, props, and scene elements are represented by mesh, while a 2D game is implemented with a sprite. Grids and sprites are ideal ways to describe "solid state" objects that are well-defined shapes. However, there are other entities in the game, which are mobile and hard to reach in nature, and thus are described using grids or sprites. For effects like flowing liquids, smoke, clouds, flames, and enchantments, different methods called "particle systems" can be used to capture the intrinsic fluidity and energy. This section explains unity's particle systems and what they can do with it. what is a particle system.

Particles are tiny, simple images or meshes that are displayed and moved in large quantities by a particle system. Each particle represents a small part of a flowing or blurred body, and the effects of all particles together form the effect of a full body. Using a cloud as an example, each particle will have a small smoke texture, as if there were a tiny clouds in it. When many such mini-clouds are placed together in an area of the scene, the overall effect is a larger, larger volume of clouds. The dynamic nature of the system

Each particle has a pre-determined existence period, usually several seconds, during which it can undergo various changes. When it is generated or emitted by its particle system, it begins its own period of existence. The system emits particles in a random position in a space area that is shaped like a sphere, hemisphere, cone, box, or any grid. The particle is displayed until the end of its existence period and is removed from the system. The system's emissivity (emission rate) indicates how many particles per second are emitted, although the exact launch time is slightly random. The selection of the emissivity and the average particle lifetime determines the number of particles in the "stable" state (at which time the emission and extinction rates of the particles are the same) and how long the system takes to reach this state. the dynamic nature of particles

The

Emission and presence settings affect the overall behavior of the system, but individual particles can also change over time. Each particle has a velocity vector that determines the direction and distance of the particle movement at each frame update. The velocity can be changed when the force or the system itself applies gravity, or when the particles are blown by the wind in the terrain. The color, size, and rotation of each particle can also change over the lifetime or change the speed of movement at the current scale. The color includes an alpha (transparency) component so that a particle can have a fade-in/fade-out effect instead of simply popping up and disappearing. In combination with the
, particle dynamics can be used quite conveniently to simulate many kinds of fluid effects. For example, a waterfall can be modeled with a slender emitter shape and the water particles simply fall under gravity. Smoke from the flames tends to rise, spread, and eventually dissipate, so the system should use an upward force of force on the smoke particles and increase their size and transparency during their lifetime. Using particle Systems in Unity

Unity uses a component to implement a particle system, so place a (particle) system in the scene, just add a Prefab object (menu: Gameobject->create general->particle System) or add components to an existing object (menu: Component->effects->particle System). Because this component is quite complex, the viewer is divided into several collapsible sub-regions or modules that each contain a set of related properties. In addition, you can edit one or more systems at the same time by entering the separate edit window via the Open Window button on the viewer. There are a number of options available in the particle system components, which are described in detail in the reference pages of the components and individual modules.
When an object with a particle system is selected, the scene view will contain a few simple control small particle effects panels to help you see the effect of changes to the particle system settings.

Playback speed allows you to accelerate or slow down the particle simulation so you can quickly see how it is in the advanced state of the form. Playback time indicates when the particle system has elapsed since it was started and relies on Playback speed, which can be faster or slower than the real time. Particle count indicates how many particles a system currently has. Playback time can be inverted or fast-forward by clicking on the Playback Time tab and sliding the mouse left and right. The buttons at the top of the panel are used to pause and resume the simulation, or stop and reset to the initial state. change properties over time

Many particles and even the entire system of numerical class properties can change over time. Unity provides several different ways to specify the occurrence of a change:
Constants: Property values are fixed values throughout the lifetime.
Curve: Specify a value with a curve/graph.
Randomly between the two constants: two constants define the upper and lower bounds of the value, and the actual value is randomly changed over the age of two boundaries.
Randomly between two curves: two curves define a given point in the lifetime, the upper and lower bounds of the value, and the current value randomly varies between the two boundaries.
For color properties, such as color over lifetime, there are two different options:
Gradient: The color value is taken from the gradient.
Randomly between two gradients: two gradient curves define the upper and lower bounds of the color value at a given time, and the value is the random weighted average of two boundary colors.

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.