\subsection{Implement the recursive path tracing algorithm (8 points)}
\subsection{Implement the recursive path tracing algorithm (8 points)}
Create a new integrator and call it \texttt{path\_tracer\_recursive}(\texttt{.cpp}).
Create a new integrator and call it \texttt{path\_tracer\_recursive}(\texttt{.cpp}).
Start with a copy of the direct lighting integrator.
Start with a copy of the direct lighting integrator.
...
@@ -208,13 +208,13 @@ However, the proper way to do it is to keep track of the \textit{throughput}.
...
@@ -208,13 +208,13 @@ However, the proper way to do it is to keep track of the \textit{throughput}.
With every bounce, the importance emitted from the camera is attenuated, and the probability for continuation should become lower.
With every bounce, the importance emitted from the camera is attenuated, and the probability for continuation should become lower.
You should keep track of this throughput in a Color3f vector, and use its largest coefficient for Russian Roulette (2 Points). Check the slides for details.
You should keep track of this throughput in a Color3f vector, and use its largest coefficient for Russian Roulette (2 Points). Check the slides for details.
\subsection{Implement and use the Diffuse BRDF / BSDF (2 bonus points)}
\subsection{Implement and use the Diffuse BRDF / BSDF (2 points)}
Encapsulate uniform hemisphere sampling of diffuse materials in \texttt{diffuse.cpp}.
Encapsulate uniform hemisphere sampling of diffuse materials in \texttt{diffuse.cpp}.
The test cases already use it, so you can store and use its albedo to generate colour!
The test cases already use it, so you can store and use its albedo to generate colour!
These 2 bonus points are only valid in conjunction with a working path tracer.
These 2 points are only valid in conjunction with a working path tracer.
Check slides for details.
Check slides for details.
\subsection{Implement path tracing in a loop (5 bonus points)}
\subsection{Implement path tracing in a loop (5 points)}
Every recursive algorithm can be written in a loop as well.
Every recursive algorithm can be written in a loop as well.
Sometimes a stack is needed, but in the path tracer that is not necessary.
Sometimes a stack is needed, but in the path tracer that is not necessary.
The loop form is much friendlier to the processor, and you can avoid stack overflows (which could happen with very deep recursions).
The loop form is much friendlier to the processor, and you can avoid stack overflows (which could happen with very deep recursions).