User Tools

Site Tools


Sidebar

hpl3:engine:optimizations

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 it by a particle system by almost 50%!!

- Premul alpha

Objects

- Use small number of objects. Same texture for same things + combine (force if needed in editor).

- IsOccluder only on important stuff.

Lights

- Only use spec when really needed.

- Do not use too many shadows (link to jens's article)

Physics

- Turn off or simplify collisions of static objects.

hpl3/engine/optimizations.1314642685.txt.gz · Last modified: 2011/08/29 18:31 by thomas