|
1 | 1 | <meta charset="utf-8"> |
| 2 | +<!-- Markdeep: https://casual-effects.com/markdeep/ --> |
| 3 | + |
| 4 | + |
2 | 5 |
|
3 | 6 | **Ray tracing: The Rest of Your Life** |
4 | 7 | Peter Shirley |
|
171 | 174 | One Dimensional MC Integration |
172 | 175 | ==================================================================================================== |
173 | 176 |
|
174 | | -Integration is all about computing areas and volumes, so we could have framed Chapter 1 in an |
| 177 | +Integration is all about computing areas and volumes, so we could have framed Chapter 2 in an |
175 | 178 | integral form if we wanted to make it maximally confusing. But sometimes integration is the most |
176 | 179 | natural and clean way to formulate things. Rendering is often such a problem. Let’s look at a |
177 | 180 | classic integral: |
|
514 | 517 | ==================================================================================================== |
515 | 518 |
|
516 | 519 | In this chapter we won't actually implement anything. We will set up for a big lighting change in |
517 | | -our program in Chapter 5. |
| 520 | +our program in the next chapter. |
518 | 521 |
|
519 | 522 | Our program from the last books already scatters rays from a surface or volume. This is the commonly |
520 | 523 | used model for light interacting with a surface. One natural way to model this is with probability. |
|
772 | 775 | (uniform) |
773 | 776 | $$ b(\theta) = 2*\pi*f(\theta)\sin(\theta) $$ |
774 | 777 |
|
775 | | -For uniform random numbers $r_1$ and $r_2$, the material presented in Chapter 2 leads to: |
| 778 | +For uniform random numbers $r_1$ and $r_2$, the material presented in Chapter 3 leads to: |
776 | 779 |
|
777 | 780 | $$ r_1 = \int_{0}^{\phi} \frac{1}{2\pi} = \frac{\phi}{2\pi} $$ |
778 | 781 |
|
|
1625 | 1628 |
|
1626 | 1629 | easier. When we sample a sphere’s solid angle uniformly from a point outside the sphere, we are |
1627 | 1630 | really just sampling a cone uniformly (the cone is tangent to the sphere). Let’s say the code has |
1628 | | -`theta_max`. Recall from Chapter 6, that to sample $\theta$ we have: |
| 1631 | +`theta_max`. Recall from Chapter 9, that to sample $\theta$ we have: |
1629 | 1632 |
|
1630 | 1633 | $$ r2 = \int_{0}^{\theta} 2 \pi \cdot f(t) \cdot sin(t) dt $$ |
1631 | 1634 |
|
|
0 commit comments