@@ -98,7 +98,8 @@ Since Nori's main loop already takes care of computing the mean for MC integrati
...
@@ -98,7 +98,8 @@ Since Nori's main loop already takes care of computing the mean for MC integrati
In addition, you will need a function that can turn a uniformly random 2D value between 0 and 1 into a uniform hemisphere sample $\omega$.
In addition, you will need a function that can turn a uniformly random 2D value between 0 and 1 into a uniform hemisphere sample $\omega$.
This transformation is called warping.
This transformation is called warping.
You can draw the 2D random values from the \texttt{sampler}.
You can draw the 2D random values from the \texttt{sampler}.
You can then apply the formulas from the lecture or look at \texttt{Vector3f Warp::squareToUniformHemisphere(const Point2f \&sample)} inside \texttt{warp.cpp} and \texttt{warp.h} to generate $\omega$.
Apply the formulas from the lecture or look at \texttt{Vector3f Warp::squareToUniformHemisphere(const Point2f \&sample)} inside \texttt{warp.cpp} and \texttt{warp.h} to generate $\omega$.
Make sure to bring $\omega$ to world space before tracing (\texttt{.shFrame.toWorld}).
Pay attention to the individual mathematical factors (including those inside $\f{p}(x)$), some of them cancel out and don't need to be computed at all!
Pay attention to the individual mathematical factors (including those inside $\f{p}(x)$), some of them cancel out and don't need to be computed at all!