350 Game Development and Simulation with Unreal Technology
horizontal and vertical sub texture in the texture we will use in the materia l should be
equal to the Sub Images Horizontal and Sub Images Vertical numbers in the Sub
UV section of the particle emitter’s Required module. Once we have such a texture,
in the Material Editor we will place a Particle Su b UV material expression and
assign the texture to it (see Figure 6.38).
Finally, with the particle material set up to accept sub images and the emitter set up
to use h orizontal and vertical sub imag es in order (or randomly), we will have to tell
the emitter how to change the sub im ages over the lifetime of a particle. In order to
do this, we will use a Sub Image Index module. The Sub Image Index module
contains a Sub Im age Index distribution. This distribution will tell your emitter how
to pick the sub images from the particle materia l. The simplest way to set this module
up is to make its distribution a Float Constant Curve distribution. Then, make
the first point to have the In Val=0 and Out Val=0. Make the second point to
have In Val=1 and Out Val=U ×V − 1. Where U is the number of horizontal sub
images an d V is the number of vertical su b images in your texture. Doin g so will
make a particle apply the upper-left texture sub image when it is spawned and go
through the sub images one-by-one through the bottom-right textur e sub image.
FIND ON THE WEBSITE
To find updates to this tutorial and upda te d instructions about its implementa-
tion on othe r UE4 versions, p le ase visit the book’s companion Website at:
http://www.RVRLAB.com/UE4Book/
TUTORIAL 6.5 Simulating Fire
In this tutorial we will set up another sprite emitter to simulate a fir e effect.
Like all other tutorials, the first thin g to do is to create a project to which we
add the particle system. The initial setup of this tutorial should resemble the
image shown in Figure 6.29.
NOTE
We will need the demo ro om to be set up before we can proceed
with the rest of the tutorial. You may find instructions to set up y our
demo room in Tutorial 6.1 on page 309.
SETTING UP THE LEVEL
To have a uniform level that we ca n work with, you may perform one of the
following options to start the work: