[Radiance-general] New occlusion testing optimization

Greg Ward wrote:

I just checked in a new optimization for light source testing that seems to speed renderings up by about a factor of 2, depending on the number and arrangement of light sources in the scene.

The way it works is simple: with each light source, we associate an array of SHADCACHExSHADCACHE OBJECT indices listing occluders in each direction as seen from the source.

(Techy stuff, so moved to radiance-dev)

Howdy Greg, and a happy new one to you too!

Just wondering: how do you resolve the spatial dependency of the shadow blocker w.r.t. direction and position on the source? This cache would have to be at least 4 dimensional to account for that.

--Roland

ยทยทยท

--
Roland Schregle
PhD candidate, Fraunhofer Institute for Solar Energy Systems
RADIANCE Photon Map page: www.ise.fhg.de/radiance/photon-map

END OF LINE. (MCP)

Hi Roland,

Happy New Year to you, too!

From: Roland Schregle <[email protected]>
Date: January 1, 2004 9:14:49 AM PST

Just wondering: how do you resolve the spatial dependency of the shadow blocker w.r.t. direction and position on the source? This cache would have to be at least 4 dimensional to account for that.

Simple. I don't. The cache is only two dimensional. The algorithm switches off when a test point is close enough to the source to trigger subdivision (controlled by -ds parameter), so we hopefully avoid the cases where the cache is made useless by the relative size of the source.

The cache is only used as a hint for one blocker to check before the rest, and it's by no means guaranteed to give you the right one. For sources that are small with respect to their distance (i.e., they cover a small solid angle seen from the test point), the hint is likely to be pretty good. In my test scene that had many large light sources, which may be tested from a great distance as well as close up, I got about a 75% success rate. Since testing a ray against a single surface (I also exclude instances and meshes from the cache), the cost of the intersection test is so cheap that adding in an extra one prior to full-blown ray tracing is really negligible.

If you want to have a look at how I do all this, the routines aren't very long, and are collected together in the new module src/rt/srcobstr.c. (I should have mentioned in my last e-mail to Jack that if he doesn't want to wait for tomorrow's dump, then he'll have to pick up this new module as well since it's not in last night's dump.) Comments are always welcome.

-Greg