Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 3D Blocks
  4. Single-Point Particle Emitter

Single-Point Particle Emitter

Scheduled Pinned Locked Moved 3D Blocks
1 Posts 1 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

    Introduction

    Although you can use the prebuilt particle emitters, you can only achieve a few predefined visual effects. To unleash the full power of particle emitters, you need to learn to build and customize the particle emitter yourself.

    Particle systems can be very complex, since we are dealing with many particles (small texture images) that are moving and changing at the same time.

    For a simple start, we will look at the “single-point” particle emitter. This means all the particles are created at the same point, and they do not move away from this point.

     
     

    Create the Single-Point Particle Emitter

    To create a single-point particle emitter, you can use the following block, and specify “Point” as the shape.

    f56e221b-161f-4e19-94d3-38b4c716f928-image.png

     
    Here is an explanation of the input parameters:

     
     

    Shape

    The shape here is not the shape of the particles, but rather the shape of the emitter that generates the particles. When we choose “Point” shape, all particles are created at the same initial position. We will discuss other shapes on other wiki pages.

     
     

    Texture

    The texture is the 2D image to be used as the particle. There are tons of textures you can select from the library.

     
     

    Facing Camera

    This input controls whether the particle images will be rotated to face the camera all the time. For example, as shown below, suppose the particle image is a 2D circle. If we make it always face the camera, then we will always see it as a full circle no matter how we rotate the camera; however, if we do not force it to face the camera, then we will see that it is always facing the up direction, and it becomes very thin when we look at it from the side.

    e2.gif

     
     

    Life Min/Max

    These 2 numbers are the minimum and maximum lifetime of the particles. For each new particle that’s generated by the emitter, its lifetime will be a random number between these 2 values. For example, if the min life is 2 seconds and the max life is 4 seconds, then the actual lifetime of any one particle can be any value between 2 and 4 seconds. Suppose it is 3.5 seconds, then after 3.5 seconds, this particle will die (disappear).

     
     

    Capacity

    The capacity controls the maximum number of particles that will be created. It is also the maximum number of particles that can be displayed on the stage. Note that this may not be the actual number of particles displayed. It will still depend on the speed at which the particles are generated, which will be specified when we start the emitter. When we create the emitter, it will immediately create all the particles according to this capacity input, and then use them when the emitter fires, and reuse these particles after they die.

     
     

    GPU

    This input controls whether we will use the GPU of the computer system when it is available. The GPU is an extra processor besides the CPU of the computer, which enables the computer to draw the particles faster, and also enables some advanced variations of the particles. Usually you should set this to “Yes” to make use of the GPU when it is available.

     
     

    Time Ratio

    The time ratio controls how fast the particle animation is carried out. You can think of it as the speed of the clock for the particles relative to the real world. The higher this number, the faster the particles will move and change.

     
     

    Name

    The last input allows us to give the emitter a name, so that we can select it later.

     

    The “Start Emitter” Block

    After you have added an emitter to the scene, you can use the “start emitter” block to make the emitter spits out particles.

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/b6dc6a26-0a07-4217-a7ec-3b732303bce4.png" width="400" style="">

    • Emitter Name: the first input is the name of the emitter. You can leave it blank if the emitter is the selected sprite object.
    • Generation Method and Count: if “by rate”, then the emitter will keep firing out particles forever, and the third input will be the number of particles emitted per second. Note that if the “capacity” of the emitter is not large enough, you may not be able to emit particles at the given rate. If you choose “for one-time count”, then the emitter will only emit the given number of particles, then the emitter will stop until you start it again.

     
     

    Example 1 - Repeatedly Firing One Particle

    Here is probably the simplest program to create and fire a particle emitter:

    ca221a3f-b44c-4879-b934-413790f556ae-image.png

     
    The capacity is 1, so there is only one particle in the system that is repeatedly used. The lifetime of this particle is 1, and it is fired at a rate of 1, so this particle will be fired out, live for 1 second, then it will die, and then it is reused to fire again.

    e3.gif

     
     

    Example 2 - One Particle with a Longer Lifetime

    Now suppose we change the lifetime to 3 seconds. Then each time the particle will live for 3 seconds. Even though the firing rate is set to 1, we still have to wait for 3 seconds before the particle dies, so that it can be reused to fire again.

    91277367-a972-456f-b61e-4592dc86bc52-image.png

     

    e4.gif

     
     

    Example 3 - More Particles with a Longer Lifetime

    To keep firing at the expected rate of 1 per second, we have to increase the capacity of the emitter to at least 3.

    127424b1-3ba8-4bcc-a6d4-8d6ad90e63b8-image.png

     
    This time, after firing the first particle, we wait one second, then try to fire again. We still have 2 unused particles, so we can afford to fire out the second particle, then we fire the third particle after another second. Therefore, we will see all 3 particles displayed, though they are at different stages of their lifetimes.

    e5.gif

     
     

    Example 4 - Higher Firing Rate

    Now let’s increase the firing rate to 3 as well, so we can see up to 3 particles at a time. Note that since the firing rate is 3, the particles will be fired at a time interval of 1/3 seconds in the beginning.

    52614006-2517-4948-852c-a7365521788e-image.png

     
    After firing out all 3 particles, when we are ready to fire again, the 3 particles are still alive, so we hit our capacity limit again, and we have to wait until a particle to die to fire a new one out:

    e6.gif

     
     
     

    Starting and Ending Particle Size

    The reason we are seeing the particle image expanding larger and larger is that each particle has a starting size and an ending size. By default, the particles start with a size of 1 and end with a size of 100.

    You can change the starting and ending sizes using the following block:

    1698032f-ff05-4ccd-8728-31a1dd76431f-image.png

     

    The first input is the name of the emitter you are updating. You can leave it blank if the emitter is the current active sprite object.

    The start size can be a range, such as between 10 to 20. For each particle, its starting size will be randomly chosen within this range.

    The end size can be a range as well.

    Lastly, you can specify the size range of the particle at an intermediate time point (between 0% and 100%). For example, you can specify that at 50% of the lifetime, the particle has to reach a size of 100. If the “progress” is set to -1, then the intermediate time point is disabled.

    Note that if the “GPU” option is set to “yes”, then you will not be able to specify a range (the second number in each pair of size numbers will be ignored).

     
     

    Example 5 - Fixed Sizes

    If we set the starting size and the ending size to be the same, then the particle won’t be showing an animation of growing. Instead, they will stay at the same size throughout their lifetimes, and multiple particles will overlap with each other:

    5df4d14a-47cb-4af2-80fd-ed4e941a8a1f-image.png

     
    e7.gif

     
     

    Example 6 - Randomly Changing Sizes

    In this example, we specify a range for the starting and ending sizes:

    f36b640d-0f10-4265-b61a-d4341ccecad9-image.png

     
    As a result, the sizes of all 5 particles are different, and the gap between the rings is not evenly distributed.

    e8.gif

     
     
     

    Starting and Ending Colors

    By default, all the particle images start as white, and end as black (transparent). You can set a starting color and an ending color for each particle using this block below. The color of each particle will gradually transit from the starting color to the ending color over the lifetime of the particle. Note that you can change the particle’s color even after it has started firing.

    38d7b5e9-195c-4de3-bfda-a636f5cac5b1-image.png

     

    The first input is the name of the emitter you are updating. You can leave it blank if the emitter is the current active sprite object.

    The starting color can be a range defined by 2 colors (only 1 color is used when the particle is “GPU” type). For each particle, its starting size will be randomly chosen within this range.

    The ending color can be a range defined by another 2 colors as well.

    Lastly, you can specify the color range of the particle at an intermediate time point (between 0% and 100%). For example, you can specify that at 50% of the lifetime, the particle has to change to a particular color range. If the “progress” is set to -1, then the intermediate time point is disabled.

     
     

    Example 7 - Set a Random Starting Color

    We can use 2 different colors (red and green) for the starting color range, and set the ending colors to be pure black. We will see that the particles take on a random color between red and green.

    c0de7923-2f8c-4dc0-8e43-449dbd26d544-image.png

     
    We can see some particles are orange and yellow:

    e10.gif

     
     

    Example 8 - Set Both Starting and Ending Colors

    If the ending color is not black, then the particles will show that color when it dies.

    b95fb7fa-a3bf-4c1f-97cf-ccca64cc537a-image.png

     
    Notice that at the edge of the circle, the particle becomes blue before it suddenly disappears. This is why we usually set the ending color to black, so that the particles become almost transparent before they die, which will look much more smooth.

    e11.gif

     
     
     

    Initial Rotation

    By default, all particles are created with no initial rotation, so they look the same. We can specify the initial rotation angle for the particles as well, using the following block:

    2df79e51-571c-4b41-b21c-ecfa05cdb2dc-image.png

     
    The first input is still the name of the emitter.

    The second and third parameters allow us to specify a range of angles. If we set the range to be between 0 degrees and 360 degrees, then the initial angle of the particle can be any value around the circle.

     
     

    Example 9 - Random Initial Rotation Angles

    In this example, we use a different texture of “magic 03” from the “Kenny” category.

    6f392dba-ae73-44f5-a44f-ae96b1586dbc-image.png

     
    This texture makes it easier to see the different angles:
     

    87342e06-2b56-4468-8f87-28ed3ddf9792-image.png

     
    This is the result:

    e12.gif

    1 Reply Last reply
    0
    • CreatiCodeI CreatiCode pinned this topic on

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode