How to Efficiently Capturing Partially Occluded Direct Solar Contributions in Enhanced Two-Phase Daylight Simulation

I used the enhanced two-phase method to calculate vertical illuminance and found that some results were biased compared with the HDR-derived values rendered using rpict. At first, I assumed that this discrepancy was caused by the approximate sun positions used in the sun-coefficient method, so I replaced them with the exact sun positions in the direct calculation. However, the biased values still remained.

After further investigation, I found that the main reason was that the direct solar contribution was not captured at certain time steps. For example, at time step 7813, the solar disk was partially blocked by the blinds. If only the center of the sun was sampled, the solar contribution became zero. I tried reducing -ds to 1e-10 to force finer subdivision of the light source, but this did not solve the problem.

I then found that when -dj was set to a larger value, the contribution could sometimes be captured after repeatedly executing the ray tracing. This is because the increased jitter raises the probability that some rays will hit the solar source. Finally, I decided to run the ray tracing 10,000 times and compute the averaged value using -c 10000. With this approach, the results matched the HDR-derived values very well, but the computation time increased significantly.

One possible acceleration strategy may be to repeat only the direct calculation with -ab 0, and then add the averaged direct contribution to the difference between the single-sample results obtained with -ab 1 and -ab 0. My question is: is this treatment reasonable, or is there a more efficient and direct way to obtain accurate results in this situation?

My command:

gendaymtx -u -of -D suns.rad -M suns.mode -m 1 weather/shanghai.wea > shanghai.smx

awk ‘NR==1{for(i=0;i<10000;i++) print}’ views/v1.pts | rcontrib -n 16 -I+ -c 10000 -y 1 -dj 1 -dt 0 -V+ -ab 1 -lw 0.0005 -M suns.mod modelb.oct > sunm_avg.mtx

As you discovered, the -ds option has no effect on “source” primitives, and does not subdivide them as it does local sources. The only way to get solar penumbras is with the -dj option, which sends at most one sample per calculation point, which is why you have found it necessary to average many samples.

The reason that this accuracy issue has not been worked on much is that there is general acceptance that relying on exact geometry and exact solar positions is typically a losing game in daylight calculations. A few minutes go by, and your value will be different by a factor of 1000. Even if you have the calculation done exactly, getting the geometry to match between model and real space is extremely difficult. To put it simply, time and geometric exactness are nearly impossible, so the high variance in the simulation mimics the high variance in the real world.

In answer to your question, there is no cheap way to get an accurate result for solar penumbras in Radiance.

Cheers,
-Greg