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.