File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 14011401doesn't matter which coordinate system you choose to use. Although, however you choose to do it,
14021402remember that a PDF must integrate to one over the whole surface and that the PDF represents the
14031403_relative probability_ of that direction being sampled. Recall that we have a `vec3` function to
1404- generate uniform random samples on the unit sphere (`random_unit_vector()`). What is the PDF of
1405- these uniform samples? As a uniform density on the unit sphere, it is $1/\mathit{area}$ of the
1404+ generate uniform random samples on the unit sphere $d$ (`random_unit_vector()`). What is the PDF
1405+ of these uniform samples? As a uniform density on the unit sphere, it is $1/\mathit{area}$ of the
14061406sphere, which is $1/(4\pi)$. If the integrand is $\cos^2(\theta)$, and $\theta$ is the angle with
1407- the $z$ axis:
1407+ the $z$ axis, we can use scalar projection to re-write $\cos^2(\theta)$ in terms of the $d_z$:
1408+
1409+ $$ d_z = \lVert d \rVert \cos \theta = 1 \cdot \cos \theta $$
1410+
1411+ We can then substitute $1 \cdot \cos \theta$ with $d_z$ giving us:
1412+
1413+ $$ f(\theta, \phi) = \cos^2 (\theta) = {d_z}^2 $$
14081414
14091415 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
14101416 #include "rtweekend.h"
You can’t perform that action at this time.
0 commit comments