Table of Contents

Optimizations

Below are various important adivice on how to get the most out of the engine. Most of these have to do with getting it to run as fast as possible, but some have to to with visual quality aswell.

Transparency

Avoid overlap
Translucent materials are quite costly perfomance-wise to render and because they both have to read and write for each pixel. At the same time many effects that use translucent materials, like billboards and particle systems, have effects that depend on overlap. For example in a fire the movement of overlapping particles create create a nice effect. For, on screen, small particle systems this is not that much of a problem. But for larger things like smoke it can be very costly. What one needs to be is to try and mimick this sort of overlap effect in a single particle in order to reduce overlap. For example b haing animated textures (using sub textures for particle system) it might be possible to do this very nicely! So beware before just pushing tons of overlapping particles or billboards to do an effect!

Alpha in all trans materials
As mentioned above, a costly aspect is of translucency is that it both read and writes. This can be reduced quite bit by skipping pixels that are not needed. Normally particles and similar and round in shape and are on a square textures. This makes the corners of of the image have pixels that are never drawn. This can be fixed to some extent by having an alpha channel and set alpha to zero in these areas. The important part is that this works even more additive, mul and mulx2 blend modes! So where ever your material is invisible (add=(0,0,0), mul=(1,1,1), mulx2=(0.5, 0.5, 0.5)) have alpha value of zero and for the rest of the pixels 1 (gradient is not needed). This reduce the perfomance hit by a particle system by almost 50%!!

Premultiplied alpha
Premultiplied alpha is not something that can increase performance, but is used to remove glitches. When using normal alpha blending it is common for some sort of images that the background (what is in the transperant area) seeps in on the more opaque areas. The reason for this is because of how the hardware works and remultiplied alpha totally removes the artifact. This video (wich features cats!) shows the issue:
http://www.youtube.com/watch?v=dU9AXzCabiM
In order to use premultiplied alpha simply copy the alpha layer in photoshop and paste it as a multiply layer on top of the rgb. Then just set the materail to use pre-multiplied alpha. Note: In order for fading to work in particles, you also need to set multiply alpha with color!

Static Objects

The fewer the objects, the better
One of the major performance hogs in 3D rendering is the number of object rendered at the same time. The reason is because it can take plenty of CPU power to handle each object and all modern GPUs work much better with a small number of objects.
So how many are too many? Well it depends. Depending on how many lights are rendered, particles on screen (and overlapping), world reflections present etc you will have more or less time to render out objects. But to give sort of pointer, having 150 objects visible at a time is a good goal. Important note: if u have only made a single room so far, do not celebrate, if u have many connecting rooms later on, all objects will not be culled or slightly visible, adding to the total number of visible objects. A maximum figure would be 300 objects, but do not get up to this until really needed!