## 6.6. Shading Algorithm.

Once an intersection tree has been created, an intensity
routine recursively traverses the tree, calculating the
intensity at each node and determining its contribution to the
final intensity of the 'pixel' represented by the tree. The
current illumination model used by most ray tracers is that
described in [WHIT 80] :

l_{s}

I = I_{a} + k_{d} (N.L_{j}) + k_{s}S + k_{t}T

j=1

where

I = final intensity I_{a} = ambient intensity

k_{d} = coefficient of diffuse reflection j = index of light source

l_{s} = number of light sources defined N = surface normal at node

L_{j} = vector in direction of light source j k_{s} = coefficient of specular reflection

S = intensity of reflected (specular) ray k_{t} = coefficient of transmission

T = intensity of transmitted ray