![]() |
| Phong shading, no shadows. |
These type of renders served as good sanity tests thanks to their simplicity and render speed. Most early changes ended up coming back to this image to make sure I didn't break anything.
Then I added shadows and a new shading model: the Cook-Torrance model. The Cook-Torrance model uses the wavelength of light to approximate specular lighting. However my raytracer doesn't use wavelengths, it uses RGB colors to simulate light. I solved this by substituting a separate equation to approximate the term.
Cook-Torrance shading relies on a different lighting model for one of its terms. In their original paper, Cook and Torrance suggest Beckman shading. However I noticed for very smooth surfaces that Beckman shading breaks down and produces sloppy results. So for smooth surfaces I substituted in Gaussian shading to approximate the term.
![]() |
| Shadows and Cook-Torrence shading. |
Here I used a smooth surface on the sphere to show the Gaussian shading.
Notice the 2 shadows and the oblong specular highlight caused by 2 light sources.
![]() |
| A rough sphere to demonstrate Beckmann influence on Cook-Torrance shading. |
The two images aren't too different. The differences between Gaussian and Beckmann influences on the Cook-Torrance model are subtle.
That covers the simple stuff for the Raytracer. Next is reflections and refractions and bounding volume hierarchy.



No comments:
Post a Comment