Particle System component
The Particle system component enables you to create dynamic visual effects like smoke, fire, rain, and explosions using particles. Built on the three.quarks library, it offers extensive customization to control how particles are emitted, behave, and render over time.
The Particle system component includes a wide array of configurable properties. These properties can be organized in the following categories:
These settings control how particles are emitted from the system.
Property | Description |
---|---|
Looping | Determines if the particle system loops after completing its duration. |
Duration | Sets how long the particle system emits particles during one cycle. A value of 0 makes the emission infinite. |
Prewarm | Starts the system in a state as if it has been running for its duration, creating an immediate effect. |
Emitter Shape | Defines the emission source's shape, such as Point, Sphere, Cone, Donut, or a Mesh surface. |
Emission Bursts | Adds bursts of particles at specific times during the emission cycle. |
Emission rate | The number of particles emitted per second, either as a constant or a range. |
These settings define how particles look and behave when emitted.
Property | Description |
---|---|
Start Life | Sets how long particles live after being emitted.
|
Start Size | Determines the initial size of particles.
|
Start Speed | Controls how fast particles are emitted from the source.
|
Start Rotation | Sets the initial rotation angle of particles.
|
Start Color | Specifies the particles' initial color, supporting solid colors or gradients.
|
Emission Over Time | Defines how many particles are emitted over time.
|
These properties define how particles are rendered in your scene.
Property | Description |
---|---|
Render Mode | Defines how particles appear in the scene. Options include: Billboard, Stretched Billboard, Mesh, and Trail. |
Particle Texture | Assigns a texture to particles. This setting supports single images or sprite sheets for animation. |
UV Tiles (X, Y) | Defines the number of tiles in a sprite sheet (columns and rows). |
Starting Tiles Index | Specifies the starting frame when using sprite sheets for animated particles. Settings include:
|
Blending | Sets the blending behavior. Options include Normal, Additive, Subtractive, Multiply, Custom, and No Blending. |
Transparent | Toggles the use of the alpha channel for transparency. |
Use World Space | Determines if particles are affected by world coordinates (enabled) or local emitter coordinates (disabled). |
Behaviors dynamically modify particle properties over time, adding realism and flexibility to your visual effects. Below is the list of supported behaviors for particles:
Behavior | Description |
---|---|
Enables particles to interact with colliders, simulating realistic collisions. | |
Adds a constant force, such as wind or gravity, to particles. | |
Organizes and manages sequences of behaviors for particles. | |
Dynamically adjusts the direction from which particles are emitted. | |
Changes particle color based on their speed. | |
Adjusts particle color over their lifespan, enabling effects like fading or gradients. | |
Spawns secondary particle systems from existing particles for layered effects. | |
Applies force to particles progressively over their lifetime. | |
Animates particles through frames in a sprite sheet as they age. | |
Simulates gravitational pull on particles, mimicking real-world physics. | |
Restricts particle speed over time, ideal for controlled effects. | |
Noise | Adds randomness to particle motion, creating organic, natural-looking effects. |
Causes particles to revolve around a point over time, perfect for vortex-like effects. | |
Rotates particles in 3D space as they age. | |
Changes particle rotation based on their speed, adding dynamic motion. | |
Modifies particle rotation as they age, enabling spinning or turning effects. | |
Adjusts particle size based on their speed, great for effects like smoke trails. | |
Alters particle size progressively as they age, allowing for growth or shrinkage effects. | |
Gradually changes particle speed over their lifespan for acceleration or deceleration. | |
Introduces turbulence to particle motion, creating chaotic, swirling effects. | |
Modifies particle width along their travel path, ideal for effects like streaks or comets. |
- Performance tips: Keep particle counts manageable, especially for mobile devices.
- Sprite sheets for textures: Ensure sprite sheets are correctly formatted, and configure the UV tiles properly.
Sprite sheets are a powerful way to create advanced animated particle effects. They consist of multiple frames of an animation stored in a single image, which the particle system cycles through to create dynamic visual effects like fire, smoke, or sparks.
To create a particle effect usign a sprite sheet, follow these steps:
Prepare the sprite sheet
Ensure your image is formatted as a grid, with evenly spaced rows and columns representing the frames of the animation. For example:
Set UV Tiles (X, Y):
Use the UV Tiles (X, Y) property to specify the number of tiles in the sprite sheet. The X value represents columns, and the Y value represents rows.
Choose Starting Tile Index
Configure the Starting Tile Index to define which frame of the sprite sheet the animation begins from. You can set it to:
- Constant: Always start from the same frame.
- Interval: Randomly choose a starting frame from a range.
- Bezier: Animate the starting frame dynamically.
Use Frame Over Life behavior
Add the Frame Over Life behavior to animate the particles through the frames of the sprite sheet over their lifespan. Configure the behavior to control the playback speed and looping options.
Following these steps, you can effectively use your sprite sheets for creating realistic particle effects in the engine.
Practical applications
Some other examples of practical applications for sprite sheet particles include:
- Fire animations: A sprite sheet could contain frames showing flames transitioning into smoke. Use Frame Over Life to play the sequence.
- Sparks: For effects like sparks, use a sprite sheet with variations in shape and brightness, cycling through them rapidly.
- Explosions: Animate explosions using a sprite sheet that transitions from a bright burst to dissipating debris or smoke.
- Limitations: Some features, like advanced Bezier curves, may have restricted functionality.