|
1572 | 1572 | For a Lambertian surface we already implicitly implemented this formula for the special case where
|
1573 | 1573 | $pScatter(\, \ldots \,)$ is a cosine density. The $\operatorname{pScatter}(\, \ldots \,)$ of a
|
1574 | 1574 | Lambertian surface is proportional to $\cos(\theta_o)$, where $\theta_o$ is the angle relative to
|
1575 |
| -the surface normal. Let's solve for $C$ once more: |
| 1575 | +the surface normal ($\theta_o \in [0,\pi]$). An angle of $0$ indicates an outgoing direction in the |
| 1576 | +same direction as the surface normal, and an angle of $\pi$ indicates an outgoing direction exactly |
| 1577 | +opposite the normal vector. |
| 1578 | + |
| 1579 | +Let's solve for $C$ once more: |
1576 | 1580 |
|
1577 | 1581 | $$ \operatorname{pScatter}(\mathbf{x}, \omega_i, \omega_o, \lambda) = C \cdot \cos(\theta_o) $$
|
1578 | 1582 |
|
1579 | 1583 | All two dimensional PDFs need to integrate to one over the whole surface (remember that
|
1580 |
| -$\operatorname{pScatter}$ is a PDF). We set $\operatorname{pScatter}(\theta_o < 0) = 0$ so that we |
1581 |
| -don't scatter below the horizon. |
| 1584 | +$\operatorname{pScatter}$ is a PDF). We set |
| 1585 | +$\operatorname{pScatter}(\frac{\pi}{2} < \theta_o \le \pi) = 0$ so that we don't scatter below the |
| 1586 | +horizon. Given this, we only need to integrate $\theta \in [0, \frac{\pi}{2}]$. |
1582 | 1587 |
|
1583 |
| - $$ 1 = \int_{0}^{2 \pi} \int_{0}^{\pi / 2} C \cdot \cos(\theta) dA $$ |
| 1588 | + $$ 1 = \int_{\phi = 0}^{2 \pi} \int_{\theta = 0}^\frac{\pi}{2} C \cdot \cos(\theta) dA $$ |
1584 | 1589 |
|
1585 | 1590 | To integrate over the hemisphere, remember that in spherical coordinates:
|
1586 | 1591 |
|
1587 | 1592 | $$ dA = \sin(\theta) d\theta d\phi $$
|
1588 | 1593 |
|
1589 | 1594 | So:
|
1590 | 1595 |
|
1591 |
| - $$ 1 = C \cdot \int_{0}^{2 \pi} \int_{0}^{\pi / 2} \cos(\theta) \sin(\theta) d\theta d\phi $$ |
| 1596 | + $$ 1 = C \cdot \int_0^{2 \pi} \int_0^\frac{\pi}{2} |
| 1597 | + \cos(\theta) \sin(\theta) d\theta d\phi $$ |
1592 | 1598 | $$ 1 = C \cdot 2 \pi \frac{1}{2} $$
|
1593 | 1599 | $$ 1 = C \cdot \pi $$
|
1594 | 1600 | $$ C = \frac{1}{\pi} $$
|
|
0 commit comments