Open Cascades opened 3 years ago
Hi Cascades, thank you for your interest in the paper. This MaxDistAlong function is actually an optimized version of the same function in CPULightCuts.h. Basically, it calculates max(p_z) in Figure 4 of Walter's Ligthcuts paper.
The rest of the GeomTermBound calculates the remaining terms of the cosine bound (equation 4 of the Lightcuts paper). "float3 d = min(max(p, boundMin), boundMax) - p" computes the minimum distance from the shading point to the bounding box of the light cluster. As I reexamine the code, I found that it computes an approximation of the min(p_x^2) + min(p_y^2) term which is only accurate when the shading normal is axis-aligned. This approximation saves computation, without noticeably affecting the sampling quality. I just added a faithful version of the Lightcuts equation (4) in my latest commit. And there is a "Use Approx Cosine Bound" option in the UI that compares these two methods.
Hi, thanks for the exciting paper! I was wondering if you could explain, or point me in the direction of how you arrived at the following code snippet? It was my understanding that the geometry term for point lights was:
but you mention cosine on the CPU-side version, and this GPU version looks like it does a lot more work than that!
I am most confused by how
MaxDistAlong
works, and what exactly it's meant to calculate. I presume it's the distance alongdir
, fromp
, to the furthest away point on the AABB? If so, I'm confused at how the component-wise multiplication ofdir
with everything helps, and what the final summation ofmax
functions is meant to represent geometrically.If you could perhaps expend/derive/diagram either of these functions I would be extremely grateful.
Again, I loved this work, thanks.