In my last post I introduced the radiosity method and form factors. Form factors answer the following question for patch i:
How much of the total of what I can see is made up of each other patch? Recall this image with a green patch i, and a visualization of the form factors with the other patches as shades of yellow.
He imagined a small (infinitesimal) piece of patch 1 called dA1. He formed a hemisphere around the tiny piece of patch and observed that any visible patch A2 could be projected on the hemisphere as a section A2′. The surface area of A2′ has a a relationship to the form factor, but not a perfect one. The reason is that sections on the top of the sphere will contribute more energy than the ones on the side because the sections on the side represent more glancing angles.
Nusselt’s Analogy takes another step by projecting the section A2′ down onto the plane of dA1 making a new area A2″. In this process, sections at the top contribute more than sections on the side of the sphere. (Specifically, by a ratio that matches the cosine of the angle of the ray from dA1 to the position of the section on the sphere to the normal of dA1.)
So if we can compute the projections like A2″ we can find the form factors.
Sampling this hemisphere with ray tracing is a nice way to find form factors. You can even sample the top of the sphere more to be more efficient (importance sampling) as long as you divide your bias out of the results.
Recall our green reference patch:
But back in the day, scanline rendering was much more economical than raytracing, and a tweak to Nusselt’s Analogy was constructed using planes making up a hemicube around dA1. Each cell of the hemicube has a form factor that’s easy to compute. If we know what patch is visible through a cell, we can assign the patch the same form factor as the hemicube cell.
We break the hemicube up into pixels for scanline rendering, and get something like this for a 2×2 hemicube on our green patch on the back of the chair.
If we trace a ray through each cell of the hemicube, we can find a patch associated with each cell.
You can imagine, this is not a great representation of the light transfer in the scene, because the green patch will only receive light from the yellow patches. Let’s look at a 4×4 hemicube:
Even with 4 times the rays, this is still a really rough approximation of the scene. Here’s an 8×8 hemicube:
Even this 8×8 hemicube can’t hit everything. Even a 16×16 hemicube can’t hit all the other patches in the scene.
That’s starting to look silly.
It might be tempting to think we need to hit ALL THE PATCHES. But in practice, in a diffuse environment, this is a lot like monte carlo ray tracing, and we just need a good enough sample of representative patches to collect light from.
It’s pretty nonsensical that I’m ray tracing hemicubes, since the algorithm was designed to exploit scanline algorithms, but this whole exercise is about exploring this algorithm and confirming some of my radiometry is working as expected.