<p>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 &quot;projected area&quot; 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.</p>
<p>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.</p>

CC BY-SA 4.0
2022-04-15T05:27:57.557Z
2022-04-15T05:27:57.557Z
Nathan Reed
<p>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.
<a href="https://i.sstatic.net/d4Xac.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/d4Xac.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2022-04-15T09:41:50.260Z
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: https://math.stackexchange.com/questions/608637/proof-of-solid-angle-theorem
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).
lightxbulb
CC BY-SA 4.0
2022-04-15T09:59:41.400Z
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.
lightxbulb
<raytracing><pathtracing><monte-carlo><importance-sampling>
importance sampling rectangular light
Sina Dasht
# importance sampling rectangular light

(Asked by: username_0 on 2022-04-14)

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](https://i.sstatic.net/d4Xac.png)](https://i.sstatic.net/d4Xac.png)

**Tags:** raytracing, pathtracing, monte-carlo, importance-sampling

> **Comments:**
> **username_1**: 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: https://math.stackexchange.com/questions/608637/proof-of-solid-angle-theorem 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).  
> **username_1**: 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 username_2 username_2.  

---

## 1 answers

### Answer by username_2 on 2022-04-15. Score: 2

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.


---

