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


I = Ia + kd (N.Lj) + ksS + ktT
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