×
Меню
Индекс

Lighting Efficiency Considerations (EN)

(страница из оригинальной справки. NDL Gamebryo 1.1)

There are several efficiency and accuracy considerations that should be taken into account when using per-vertex dynamic lighting:
 
·         Ambient lights are (by far) the least expensive to compute.
Directional lights are the next least expensive to compute, with point lights being more expensive and spotlight the most expensive.
 
·         When using point and spotlights, setting distance attenuation curve parameters to Quadratic=0, Linear=X and Constant=0 may speed up lighting computation (thus making the light attenuate linearly with distance).
 
·         Applications choosing to use specular lighting should do so with as few lights and objects as possible, as specular lighting is expensive to compute.
 
·         All lighting is computed on a per-vertex basis. As a result, spotlights will tend to have artifacts when projected upon objects whose polygonal representation is coarse.
For example, a spotlight with a small cone angle pointed directly at the center of a large wall represented by two triangles may not illuminate the wall at all (if all four vertices of the wall fall outside the cone angle).
 
·         Applications that use lighting effects that are not dynamic (i.e. lights for which no parameters change during program execution) should strongly consider avoiding dynamic lighting and simply "pre-light" their geometry by factoring the lighting into vertex colors or into the texture maps.
 
·         If applications do not need to use vertex colors (i.e. vertices are all white or all the same color), they should avoid creating geometry that contains "dummy" vertex colors, as they will incur a computational cost for all vertex colors during lighting computation.
 
·         Applications should avoid changing the per-vertex source colors that are specified in the NiGeometryData on a per-vertex basis, as doing so may invalidate cached versions of the data in the renderer. If possible, applications should rely on dynamic lighting to assign per-frame dynamic vertex colors.