# Illumination model used in the "Raytracer in a weekend" series

I was going through the raytracer in a weekend book by Peter Shirley and the subsequent book raytracing the next week and I couldn't make out what was the illumination model that was being used here.

all the previous raytracing samples that I have come across use the Phong shading model in which

• For a diffuse surface, a shadow ray is generated towards all the light sources and the final color is calculated based on the diffuse color and the non-occluded light intensities
• For reflective materials and dielectrics, reflective and refractive rays are generated which are then recursively projected into the scene

The method used in the book (very briefly) is as follows (Please do correct me if my understanding is wrong in any way)

• For diffuse objects, a ray is traced recursively in a random direction biased towards the normal at the hitpoint and the color from the resulting ray is multiplied with the current object's albedo to give the final color
• For reflective and dielectrics, rays are cast using the law of reflection and the Snell's law respectively.
• Lights also scatter rays and also add their emitted parts.

The major differences I see in this approach are

• We do not directly sample the light sources.
• Diffuse items also reflect rays (for inter-diffuse reflections)

What exactly is the illumination model used in this approach? and why does this approach seem so simple and yet produces pretty good results?

Sorry if I missed something, I am relatively new to raytracing

• Seems to me he is is simulating global Illumination, which is basically indirect lightning due to light coming at surface after being reflected from other surfaces. So yeah, we don't just shoot rays from intersection point (IP) to light directly, instead we shoot random rays from IP in order to simulate that indirect lighting coming from different surfaces. Jun 10, 2018 at 13:45
• These are two different illumination model: Local vs Global illumination. Global illumination considers all the light paths and its interaction with surfaces. A diffuse surface for example does not only receive light from a light source but scatters light in multiple direction around its local hemisphere which needs to be recursively traced. The later approach is very costly and needs statistical approach(monte carlo integration) to solve.
– ali
Jun 13, 2018 at 8:31

I have not read the links but you remember that in the classical ray tracing ,namely Whitted rayTracing, a single ray is traced from viewpoint to each pixel and alone if a complete diffusive surface is intercepted the reflected ray (secundary ray) isn't calculated. Practically the contribution of indirect illumination on the specular diffusive surface is multiplied for $K_s$ i.e. the specularity coefficient of material and if diffusive coefficient $K_d$ is very hight $K_s$ will be very low and thus the reflective ray in that point isn't traced thus there will be a threashold to stop recursion. Furthermore the recursion tree is a binary tree because is launched between secundary ray the rifraction ray also.