# "Importance Sampling of Many Lights with Adaptive Tree Splitting" - paper: participating media

I'm reading and implementing a paper about Importance Sampling of Many Lights with Adaptive Tree Splitting. In section 5.2 on cluster importance for participating media, there is a part that I don't understand: How do they compute the vectors o1, o2? I don't understand the paragraph explaining how to obtain this basis from v1, v2. Can anyone explain it?

Someone else feel free to correct me as I am not 100% certain, but from what I can gather:

They are describing all the normalized vectors v, which point at the ray between points v1 and v2.

They are doing this using one parameter angle φ.

They are essentially interpolating between two vectors o1 and o2, with the equation v = o1 cosφ + o2 sinφ

o1 is simply the normalized v1. o2 is a vector at right angles with the o1 along the plane of the ray. (I think this would be calculated by cross product of o1 and N from the paper).

Because this angle can sweep greater than the length of the ray defined by v1 and v2 they also define a limit Bmax so that φ always stays within the bounds of the ray.

I've tried to annotate the diagram below (but I think I made a mistake and o2 would have an angle create than v1).

They also discuss it briefly here: http://www.aconty.com/pdf/importance-sampling-lights-slides.pdf

Might be worth mesaging the orinal authors to see if this is correct.

• Thanks for the detailed answer with diagram! It clears a few things up. But now I'm confused about bmax. They compute it with v0, v1, and those vectors could have any length, right? I don't understand how bmax can be a valid cos(angle) in that case. Oct 2, 2020 at 21:38
• Your right, it looks like I am completely wrong about bmax! Seems like bmax is cos(θmin) if the actually minimum falls out of the range between v0 and v1. So it is the cos of the angle between Axis and v0/v1 (whichever is shorter)? Then it is selecting bmax if v0 dot v1 is < cosφ (which is what I thought bmax was). You also seem to be correct about them needing to be normalized. Potentially a mistake in the paper? Oct 3, 2020 at 16:27
• I asked the author of the paper, and he was kind enough to clarify that v0, v1 should be normalized here. Oct 9, 2020 at 9:09
• Fantastic! Glad you were able to followup. Most people probably don't implement equangular sampling so I guess it must have slipped through. Oct 9, 2020 at 15:20