Every developer who creates real-time applications
that use three-dimensional (3-D) graphics is concerned about performance
optimization. This section provides you with guidelines about getting the best
performance from your scene.
- Keep the textures small.
- Only set needed textures in material
- D3D Effect (Shader Text) heavy debase
performance, especially work with multi-texture. Only use shader when really
needed (if possible, instead of it by checking object's styles like Alpha
Test, Alpha Blend, Color Add...); if a material include shader text, assign
it to objects as less as possible.
- Check material's No Receive Shadow option for unneeded object
like sky, also mesh's No Shadow option.
- If use shadow mapping, Spot light is
much efficient than Point light.
- There are several console variables notably affect performance, turn off
them as possible: r_terrain_dynamic_lights, r_dynamiclighting,
- Check Exclusive VB style for meshs. This feature
use more video memory but can speed up rendering, especially for massive
- For scripting, keep the " .new() " invocation out of loop as possible,
because the ".new()" function is slow. If a function's return
value is a class (e.g. vec, color, rect, etc), it will call ".new()" inner.
See example code:
for i=0,9999 do
local v=v1+v2 -- most operator function also has a inner .new() call
print(os.clock()-starttime) -- approximately 1
for i=0,9999 do
print(os.clock()-starttime) -- approximately 0.01
- There is a console variable "r_perfhud", you can turn on it to
see performance analysis ( also need turn on device message in Winds3D
Player's Option > Device Message ).