Why the irradiance cache is disabled in rcontrib (rfluxmtx)?

Below is my undersatnding on irradiance cache:

Random direction sampling over the hemisphere at each pixel needs to be done due to the uncertainty of diffusing reflectance when using standard Monte Carlo ray tracing. However, this will result in a huge computational load. To solve this problem, an irradiance cache was introduced. Random sampling is only performed for a selection of points over the hemisphere, and the irradiance values of these points are stored to interpolate values between them. The irradiance cache mechanism can accelerate rendering. This is my understanding of the irradiance cache after reading some literatures, but I’m not sure if my understanding is correct.

However, I’m confused as to why the mechanism of the irradiance cache is disabled in rcontrib/rfluxmtx. If the mechanism were enabled, the matrix-based daylight simulation would be more time-efficient, especially for the five-phase method, as the image-based daylight simulation for direct sunlight takes several hours. If some factors make the irradiance cache mechanism impossible to implement in rcontrib, is it possible to use rpict/mkillum to calculate the direct sunlight contribution at each timestep? This method is time-efficient because it can use the irradiance cache and only requires one bounce. Certainly, it will lose the ability to parameterize locations, but it would still be useful in many application scenarios. Another advantage of this method is that it can use the exact sun position for simulation. I’m not sure if anyone has already done similar research.

Someone may say that the irradiance cache is only valid for the indirect calculation, and the direct sunlight contribution belongs to direct calculation. However, when calculating the luminance distribution on indoor surfaces contributed by direct sunlight, the indirect calculation is also conducted. The direct sunlight hits the indoor surfaces and enters the eyes through diffuse reflection.

These are good questions, and I encourage you to conduct some experiments to test your ideas on optimizing the 5-phase method. I do not know who may have done similar work, but the Radiance workshop is an excellent place to inquire. This year’s workshop is being held in Innsbruck, Austria, in August.

Regarding why rcontrib does not use the irradiance cache, it is due to accounting issues. The nature of rcontrib requires knowing exactly how much each ray sample contributes to the final value. This is impossible to do if an intermediate value is cached and shared between samples. Effectively, you would need to store the entire ray tree associated with each cached value, which would quickly consume all the available memory.

Cheers,
-Greg

1 Like