User Tools

Site Tools


gamedev:particleemitters

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gamedev:particleemitters [2011/09/19 15:56] – [Types] dragonlordgamedev:particleemitters [2019/05/24 23:43] (current) – ↷ Links adapted because of a move operation dragonlord
Line 1: Line 1:
-====== Particle Emitters ======+{{tag>particle graphic physics collision}} 
 +<WRAP youarehere> 
 +[[:start|Start Page]] >> [[:gamedev|Game Development with the Drag[en]gine]] >> **Particle Emitters** 
 +</WRAP> 
 Particle emitters allow to create particles in the game world influenced by physics. Physical behavior is not mandatory but the default behavior. Particle systems are split into two individual components to simplify the process of defining and using particles. Particle emitters are defined once and are then reused multiple times using instances. Emitters support both continuous and burst like emission of particles. For fine grained control over the properties of generated particles controllers are used. These work similar to controllers in [[gamedev:animators|animators]]. Furthermore emitters support collision emitters to simplify creating cascaded emitters like rain drops hitting the floor bursting into smaller drops upon impact. Emitters can also be set to self-destroy after the last particle has died. This allows to use particles in a deploy-and-forget manner. Particle emitters allow to create particles in the game world influenced by physics. Physical behavior is not mandatory but the default behavior. Particle systems are split into two individual components to simplify the process of defining and using particles. Particle emitters are defined once and are then reused multiple times using instances. Emitters support both continuous and burst like emission of particles. For fine grained control over the properties of generated particles controllers are used. These work similar to controllers in [[gamedev:animators|animators]]. Furthermore emitters support collision emitters to simplify creating cascaded emitters like rain drops hitting the floor bursting into smaller drops upon impact. Emitters can also be set to self-destroy after the last particle has died. This allows to use particles in a deploy-and-forget manner.
  
 ====== Emitters ====== ====== Emitters ======
-Emitters contain the definition of a single particle system. Emitters are non-resource objects hence they are not loaded from a file but build at run-time. This allows the user to use his own way of storing particle systems. An emitter should not be changed after it has been initialized and is in use by instances. Emitters can emit particles either continuously or in bursts. The default behavior is to emit particle continuously. In this mode the interval parameter is used to determine the time until the next particle is emitted. The number of particle emitted each time the interval elapses is defined using the particle count parameter. In burst mode particles are emitted once only. In burst mode the particle count parameter is also evaluated over the burst lifetime of the emitter. This lifetime defines the length of a burst. Using the progress curve of the particle parameter multiple emissions of particles can be defined along the burst lifetime. Thus it is possible to fine tune the emission behavior of particles in a burst if required. More information about this can be found in the particle count parameter section.+Emitters contain the definition of a single particle system. Emitters are non-resource objects hence they are not loaded from a file but build at run-time. This allows the user to use his own way of storing particle systems. An emitter should not be changed after it has been initialized and is in use by instances. Emitters can emit particles either continuously or in bursts. The default behavior is to emit particle continuously. In this mode the interval parameter is used to determine the time until the next particle is emitted. The number of particle emitted each time the interval elapses is defined using the particle count parameter. In burst mode particles are emitted once only. In burst mode the particle count parameter is also evaluated over the burst lifetime of the emitter. This lifetime defines the length of a burst. Using the progress curve of the particle parameter multiple emissions of particles can be defined along the burst lifetime. Thus it is possible to fine tune the emission behavior of particles in a burst if required. More information about this can be found in the particle count parameter section. The layer mask and group number are set to each instance the emitter is assigned to. This is required for cascaded emitters since the game code does not have access to the created instances. You can still though change the layer mask and group number in instances you have access to after you set an emitter.
  
 ^Name^Description^Type^Default^ ^Name^Description^Type^Default^
 |Emit Burst|Determines if particles are emitted continuously or in bursts|Boolean|False| |Emit Burst|Determines if particles are emitted continuously or in bursts|Boolean|False|
 |Burst Lifetime|The life time in seconds of the emitter if using burst mode|Float|1.0| |Burst Lifetime|The life time in seconds of the emitter if using burst mode|Float|1.0|
 +|Layer Mask|Collision mask.|LayerMask|(empty)|
 +|Group Number|Collision group number|Int|0|
 |Controllers|Controller definitions.|ParticleEmitterController[]| | |Controllers|Controller definitions.|ParticleEmitterController[]| |
 |Types|Particle type definitions.|ParticleEmitterType[]| | |Types|Particle type definitions.|ParticleEmitterType[]| |
Line 49: Line 55:
  
 <WRAP center round info 90%> <WRAP center round info 90%>
-If the particle is moving at different velocities the density of the trail emitter varies. You can create a trail emitting the right amount of particles depending on the velocity using the **Trail Controllers**. Simply create a trail emitter with a single controller and set in the **Trail Controller** for **linear velocity** to the index of this controller (0 in this example). The value of the trail controller is now always set to the linear velocity of the particle it is attached to. Now use this controller on the **interval** parameter and you can control precisely the density of your trail or any other parameter as you see fit.+If the particle is moving at different velocities the density of the trail emitter varies. You can create a trail emitting the right amount of particles depending on the velocity using the **Trail Controllers**. Simply create a trail emitter with a single controller and set in the **Trail Controller** for **linear velocity** to the index of this controller (0 in this example). The value of the trail controller is now always set to the linear velocity of the particle it is attached to. Now use this controller on the **interval** parameter and you can control precisely the density of your trail or any other parameter as you see fit. The required interval can be easily calculated using overlap*(size/velocity). **Value** of the parameter acts as the overlap value which makes it easy to adjust the overall density. Calculate a bunch of values for different velocities inside the controller range and you have a basic curve keeping density equal.
 </WRAP> </WRAP>
 +
 +Types can have different simulation types. Using **particle** as **Simulation Type** simulates particles the default way. Using **ribbon** all generated particles are connected using a ribbon in the order they have been cast. Use [[gamedev:skinproperties|Skin Texture Properties]] to alter how the rendering is done. In general there is a strict separation between properties affecting rendering only and properties affecting also the physics part of particles. Later ones only are stored in the emitter types. Last simulation type is **beam** which renders a beam for each particle between the cast position and the final position which is the particle simulated over the entire lifetime.
 +
 +Using **Interval As Time** the usage of the **interval** parameter can be modified. By default the interval is used over time. Hence if the interval parameter for example resolves to 0.1 then a particle would be cast after 0.1 seconds. If **Interval As Time** is set to true though the usage changes to over distance instead of time. Hence with an interval value of 0.1 a particle would be cast after the emitter instance displaced by 0.1 meters from the last time a particle has been cast. This can be used for trail particles to have better control as well as for ribbons in connection with dynamically moving emitter instances.
  
 ^Name^Description^Type^Default^ ^Name^Description^Type^Default^
Line 57: Line 67:
 |Model Skin|Skin for the model to use. Allows to alter emission parameters depending on where a particle is emitted.|Skin|null| |Model Skin|Skin for the model to use. Allows to alter emission parameters depending on where a particle is emitted.|Skin|null|
 |Cast From|Determines from what element of the Model (if set) particles are emitted from.|{Vertex, Face, Volume}|Vertex| |Cast From|Determines from what element of the Model (if set) particles are emitted from.|{Vertex, Face, Volume}|Vertex|
 +|Simulation Type|How to simulate the particle emitter. Also defines how it is rendered.|{Particle, Ribbon, Beam}|Particle|
 +|Interval As Distance|Determines if the interval parameter is used over time (seconds) or over distance (meters).|boolean|False|
 |Trail Emitter|Emitter to use as the trail for particles.|ParticleEmitter|null| |Trail Emitter|Emitter to use as the trail for particles.|ParticleEmitter|null|
 |Trail Controllers|Defines which controller (if any) in the trail emitter instance is set with particle parameters.|Int[]|-1| |Trail Controllers|Defines which controller (if any) in the trail emitter instance is set with particle parameters.|Int[]|-1|
Line 150: Line 162:
 Defines the emit direction for particles creating instances upon impact. If set to 0 the created instance is oriented along the normal of the impact surface. If set to 1 the created instance is oriented along the repel direction as calculated using roughness. Defines the emit direction for particles creating instances upon impact. If set to 0 the created instance is oriented along the normal of the impact surface. If set to 1 the created instance is oriented along the repel direction as calculated using roughness.
  
-====== Links ====== +====== Examples ====== 
-  * [[gamedev:main|Game Development Informations]] +{{ youtube>6rdYWmf1yZc?600x450 |Particle Beams Example Video}}
-  * [[:start|Main page]]+
gamedev/particleemitters.1316447761.txt.gz · Last modified: 2011/09/19 15:56 by dragonlord