\chapter{Module RayTracer}

Jiří Bittner, bittner@fel.cvut.cz \\
Antonín Míšek, antonin.misek@skoda-auto.cz \\
15. října 2015

\section{What is it?}
It is a rendering module, which use the ray tracing method. It uses progressive rendering of image and it is very interactive. It can run in real time in CAVE in Škoda auto a.s. Module can also run in server mode without vizualization window, it can calculate the images by the order \uv{renderimage} or in collaboration with module Cluster as a client for distributed ray tracing.

\section{Implementation}
Currently is fully functional CPU implementation, which can render without shadows, with straight shadows and with global illumination. It uses two levels BVH acceleration structure (one is on level of nodes in the scene and the second is above the triangle meshes).
Computation intensive parts use SSE, AVX or AVX2 instructions (choosen at compilation time).

\section{Control}

\subsection{sceneID}
ID of the scene, which has to be draw. 

\subsection{cameraID}
ID of the camera, which has to be used for drawing. 

\subsection{maxLights}
Maximum number used lights (it use the first lights in the scene). 

\subsection{maxRecursionDepth}
Maximum depth of recursion. 

\subsection{trianglesPerLeaf}
Number of triangles in leaves of BVH (real number may be bigger).

\subsection{shadows}
Turn on shadows. 

\subsection{rayOffset}
Move of ray during recursion (help against numeric errors).

\subsection{headlight}
Turn on/off point lighting in camera position. 

\subsection{cameraType}
Type of camera used for rendering.

\subsection{radialDistortion}
Turn on/off the simulation of deformation the picture as real lens. 

\subsection{horizontalFOV, verticalFOV}
Angles define width/height view of camera. 

\subsection{optimization}
Optimalization parameters for BVH. 

\subsection{drawTimeouts}
Time setting for calculation before first draw of picture and time among progressive improving.

\subsection{fullPolarization}
Set the matematical model for simulation of the polarization.  

\subsection{samplesPerPixel}
Maximum number of sample to one pixel. 

\subsection{samplingStrategy}
Choice of algorithm for distribution of pixels in progressive rendering. 

\subsection{filterRadius}
Radius of smoothing filter. The negative values enable automatic radius computation.

\subsection{contrast, brightness}
Adjustment of contrast and brightness in postprocessor. 

\subsection{syncRendering}
Draw after the complex calculation first pass according to samplingStrategy. It doesn't have to respect first time in drawTimeouts.

\subsection{usePathTracing}
Turn on global illumination.

\subsection{renderThreads}
Number of threads use for calculation (recommended value for interactive projection is number of available cores minus one).

\subsection{remoteTiles}
Number of blocks, which will try to send to clients. 
