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] :

                                     ls

I = Ia + kd (N.Lj) + ksS + ktT
j=1
where
I = final intensity Ia = ambient intensity
kd = coefficient of diffuse reflection j = index of light source
ls = number of light sources defined N = surface normal at node
Lj = vector in direction of light source j ks = coefficient of specular reflection
S = intensity of reflected (specular) ray kt = coefficient of transmission
T = intensity of transmitted ray