366 Game Development and Simulation with Unreal Technology
We have already worked with GPU Sprites type data in Tutorial 6.4 when we cre-
ated a Blizzard effect.
In the following we will discuss more details about this type data and how it will be
beneficial to c reate interesting visual effect.
The GPU Sprites type data have the following properties [19]:
TABLE 6.5: GPU Beam Properties
Camera Motion Blur Amount: How much to stretch sprites based on cam-
era’s motion blur.
The GPU Sprites type data does not support all of the modules and emitter attributes.
Table 6.6 shows available attributes for GPU particles [20]:
TABLE 6.6: GPU Attributes
Initial Location:
Determined a t spawn time.
Supp orts most methods available to CPU particles.
Initial Velocity:
Determined a t spawn time.
May inherit velocity from the spawn source.
Acceleration:
Constant for a ll particles a c ross th e lifetime of the emitter.
Drag:
Initial drag coefficient is determined at spawn time an d may vary per
particle.
May be scaled over the life of the particle by a curve.
Lifetime:
Determined a t spawn time and may vary per particle.
Color:
Initial color dete rmine d at spawn time . T h is color is the same for all
particles.
May be scaled over life by a curve. The curve is shared among all
particles.
Size:
Initial size is de te rmine d at spawn ti m e and may vary per particle.
May be scaled over life by a curve. The curve is shared among all
particles.
(Continued on Next Page)
Visual Effects and Cascade in Unreal Engine 367
(GPU Attributes Continued)
Rotatio n:
Determined at spawn time and may vary per particle.
Rotatio n Rate:
Determined at spawn time and may vary per particle.
Sub Image Index:
The sub image index varies over the life of a particle as defined by
a curve.
The curve is shared among all particles.
GPU Particles Mo tion [17]
Particle motion is governed by simple Newtonian dynamics. At e ach time step, a
particle’s position and velocity are integrated forward based on its current position,
current velocity, a constant acceleration and force due to drag.
GPU particles a lso support orbit, tho ugh the details differ from that provided for
traditional CPU particles. Conceptually, the particle moves as if the sprite is o rbiting
around the actual location of the particle offset by a varying amount. Orbit can be
used to ad d additional d etail motion to particles.
Vector Fields [21]
The most interesting feature of GPU particles, aside from their efficiency, is vector
fields. A vector field is a uniform grid of vectors that influences the motion of par-
ticles. Vector fields are placed in the world as Actors (Global Vector Field) and can
be translated, rotated and scaled like any other Actor. They a re dynamic and may be
moved at any time. A field may also be placed within Cascade (Local Vector Field),
limiting its influence to the emitter with which it is associated. When a par ticle enters
the bounds of the vector field , its motion will be influenced by it and when a particle
leaves the bounds, the influence of the field will fade out.
By default, vector fields imp art a force on particles within them. Vector fields also
have a “tightness” parameter. This parameter controls how directly particles follow
the vectors in the field. When tightness is set to 1, particles read their velocity dire ctly
from the field an d thus follow the field exactly.
Static vector fields ar e those in which the grid of vectors never change. These fields
can be exported from Maya and imported as a volume texture. Static fields ar e very
cheap and can be used to add interesting motion to particles, especially by animating
the motion of the field itself.
Additionally, vector fields may be reconstructed from a 2D image. In this case, an
image much like a normal map ca n be imp orted and used to reconstru ct a volume
texture by extruding or revolving it around a volume. A static vector field may be
368 Game Development and Simulation with Unreal Technology
added on top of this reconstruction to introduce some noise a nd randomness. Further,
the 2D images may be animated by storing individual frames in an atlas texture.
Doing so allows you to perform a fluid simulation offline and reconstruct the motion
in real-time a t very little cost.
Performan ce of GPU Particles [18]
The CPU cost of GPU particles is dominated by the spawning of particles. Because
particles are spawned on the CPU using the sam e methods as traditional CPU parti-
cles, the performance charac te ristics are similar.
The GPU cost of particles is primarily determined by the number of particles. Few
features add additional cost to GPU particle s above the fixed cost that already ex-
ists. The majority of the GPU cost can be attributed to sorting and rendering. Sorting
is optional and should be enabled only when required for a particular emitter. Ren-
dering is often dominated by fill rate. Reducing the size of particles, the number of
instructions on a particle’s material and the total number of particles can all help. In
some cases when the particles are very small, rendering is dominated b y vertex cost
in which ca se reducing the number of particle s is the only way to reduce cost.
6.8.2 BEAM TYPE DATA
The Beam
2
type data module indicates that the emitter sh ould output beams [44].
This will make the emitter con nect particles b etween a source po int and a target
point.
For example, you may choose the source to be the emitter actor and the target point
to be the player actor. This will make a stream of particles between the location of
the emitter and the player to create effects such as lighting hitting the actor.
The Beam type data has the following properties, as shown in Table 6.7 , according
to the Unreal Engine 4 official documentation [2]:
TABLE 6.7: Beam Beam Properties
Beam Method: This property allows for setting the method for generation
of the beam:
PEM2M_Distance: E m it the beam along the X axis of the emitter.
PEM2M_Target: Emit the beam from s ource to a supplied target.
PEM2M_Branch: Unused.
(Continued on Next Page)
2
The contents of this section are adopted from the official UE4 online documentation found at:
https://docs.unrealengine.com/latest/INT/.
Visual Effects and Cascade in Unreal Engine 369
Beam Beam Pro perties Continued
Texture Tile: The number of times a texture is to be tiled alon g the beam.
Texture Tile Distance: The distance along the beam that represents one tile
of the texture.
Sheets: The number of sheets to render along the beam.
Max Beam Count: The maximum number of live b e a m s the emitter can
have.
Speed: The sp e e d at whic h the beam moves from the source to the target.
A value of 0 will make the beam jump intravenously from the source to
the target.
Interpolation Points: This number wi ll allow the beam to use tangents along
its path from the source to the target. Negative values will make the beam
a straight li n e . Positive non-zero values wi ll make the beam utilize as many
tangents as the specified nu m ber to create curvatures along th e path.
Always On: If set to true will make beam to always have live particles.
Up Vector Step Size: The approach to use for determining the up vector of
the beam:
0 The up vector should be calc u lated at every poi n t in the beam.
1 The u p vector should be calculated at the start of the beam and
then used for all other points.
2 The up vector should be calculated at every N-points Currently
unsupported.
TABLE 6.8: Beam Taper
Taper Metho d: How the b e a m is tapered along its le n gth. It can be one of
the following values:
PEBTM_None No tapering is applied to the beam.
PEBTM_Full Taper the beam relative to source moving to target,
regardless of current beam length.
PEBTM_Partial Currently unused.
Taper Factor: A distribution supplying the amount to taper the beam. When
using a constant curve, a time value of 0.0 represents the taper at the
source of the beam, whil e a time value of 1.0 is the target.
Taper Sca le : The amount of scaling for the taper.
370 Game Development and Simulation with Unreal Technology
TABLE 6.9: Beam Dist ance
Distance: This float distribution provides the distance alo n g th e X axis the
be a m should travel when th e Beam Method is set to PEB2M_Distance.
TABLE 6.10: Beam R endering
Render Geometry: If set to true, the actual geometry of the beam wi ll be
rendered. Usually used, as otherwise the beam trail wil l not be visible.
Render Direct Line: If set to true, a direct line will be rendered. Used for
debugging in Cascade Particle Editor.
Render Lines: If set to true, line s will be rendered alo n g each segmen t of
the beam. Used for debugging in Cascade Particle Editor.
Render Tessellation: If set to true, a tessellated path will be rendered along
the beam. Used for debugging in Cascade Particle Editor.
6.8.3 MESH TYPE DATA
The Mesh
3
type data module indicates that the emitter should use static mesh in-
stances as each par ticle [ 44]. For example, yo u may c hoose a static mesh to be used
and create effects such as a firing machine gun, shrapnel or d ebris.
The Mesh type data has the following properties according to the Unreal Engine 4
official documentation [41]:
TABLE 6.11: Mesh Properties
Mesh: This prope rty i s the Static Mesh that is rendered at the position o f
the emitter’s particles.
(Continued on Next Page)
3
The contents of this section are adopted from the official UE4 online documentation found at:
https://docs.unrealengine.com/latest/INT/.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.138.178