2
$\begingroup$

I have been struggling very much to wrap my head around this part of Peter Shirley's book. There is no explanation what the angle Alpha represents and to make things worse in the code the cos(Alpha) is calculated is the y component of the direction vector from hit point to a random point on the light source. The whole thing makes no sense and I am struggling to find any resources to help me along. enter image description here

$\endgroup$
2
  • $\begingroup$ It's the factor that pops out when you rewrite the integration over the hemisphere as integration over scene surfaces. See stewart's calculus link here for a proof: math.stackexchange.com/questions/608637/… It can also be shown using differential forms, it's the factor that arises from projecting an arbitrary differential area on the unit sphere (it's the Jacobian of such a map). $\endgroup$
    – lightxbulb
    Apr 15, 2022 at 9:41
  • $\begingroup$ If $Q$ is the point on the light and $P$ is the center of the hemisphere, then alpha is the angle between $P-Q$ and the normal at $Q$ (the normal at the point on the light), as already noted by Nathan Reed. $\endgroup$
    – lightxbulb
    Apr 15, 2022 at 9:59

1 Answer 1

2
$\begingroup$

From looking at the equations, it looks to me like alpha must be the angle between the surface normal of the light source, and the ray direction. This is the "projected area" factor: the amount of solid angle subtended at the receiving point has to be scaled based on how much the light source is tilted away from the receiver.

The calculation of cos(alpha) as the y component of the direction vector, I suppose, must be in the coordinate system of the rectangle light, where xz is the plane of the rectangle. In such coordinates, the normal will be (0, 1, 0), and cos(alpha) would reduce to dot(direction, normal) which would be direction.y.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.