Main /
Particle Emitter Optimization
Search:  

Academy Topics

Articles relating to Active Worlds
Help with Objects, Textures, Masks, Coronas, Movers, Avatars, Sequences and more.
Guides on how to do various things in Active Worlds
Graphics, ads and sounds for use.
Downloadable AWG's, Particles, Movers and Building Code

Resources (...)

SW City Network

Overview


This small guide goes over some formulas and methods regarding particle emitters.

Particle Capping


There can only be around 1200 particles "in the field" at a time per emitter. If you have more than this, you'll notice your particles suddenly disappearing prematurely, and ignoring the fade out times. Here's are some tips:

  • To check your emitter, take the particle lifespan, divide it by the release time, and mulitple that by the release count. This number should not exceed 1024. (Lifespan / Release Time) * (Release Count)

    Example: A snowflake emitter has a lifespan of 5000, a release time of 100-100, and a release count of 5. 5000 / 100 * 5 = 250, which is less than 1024.

    If your release time min and max aren't the same, use the average. Just be sure you have some headroom because there might be release bursts which'll bring you over the cap.
  • If 1024 is not enough, simply add multiple copies of the emitter. The particle capping is per-emitter, after all.
  • If your creating transparent particles, like smoke, haze and steam, do not increase the release count to bolster up the effect. Just increase the transparency or the particle size instead.

Drawing order


For complex emitters, drawing order can become a pain. For example, if you have particle based clouds, and particle based rain, you may notice that you can't see the rain when its being rendered against the clouds in the background. This is because the clouds are being rendered "infront" of the rain. Draw order conflicts effect many other scenarios too, such as liquid pools of any sort, gassy areas, etc etc. You probably know what I'm talking about if you've worked with particle emitters enough.

You may not notice anything wrong with the drawing order at first while you're building it, but restart AW and check again. The browser will place the first emitters it sees ontop of the drawing order, and everything else behind that. If you have multiple emitters in one cell (which you'll need to do anyway if you plan to fix it), AW is somewhat random in what emitters it will place ontop.

In order to manipulate the draw order, you have to use AAA (astart astop animation).

  1. Name all your emitters first. Give them unique names. This is the tag field in the emitter properties. For this example, let's say you named the rain "rain" and the clouds "clouds". Simple enough.
  2. Create two objects to apply the AAA code to (place these in the same cell as the emitters), and use this code:
     Object 1:  create animate me 1. 1 1 50,astart;adone tag rain
     Object 2:  create animate me 1. 1 1 100,astart;adone tag clouds

Note the 50 and 100 part of the code. This is the delay. When object 1 loads, it will wait 50 milliseconds, then activate the rain emitter. Object 2 loaded too, but it'll wait 100 milliseconds before activating the cloud emitter. Using these delays, you can control the draw orders.

I seperate the delays out 50 milliseconds each, but if the area is very laggy you will need to increase this because AW's timings become flakey during lag.

To add more draw orders, just add more AAA objects and increase the delay for each layer to render.

Page last modified on January 10, 2007, at 05:27 PM
Edit SideBar Edit Page | Page History | Print