SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLPathtracer.h
Go to the documentation of this file.
1 /**
2  * \file SLPathtracer.h
3  * \date February 2014
4  * \authors Thomas Schneiter, Marcus Hudritsch
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8 */
9 
10 #ifndef SLPATHTRACER_H
11 #define SLPATHTRACER_H
12 
13 #include <SLRaytracer.h>
14 
15 //-----------------------------------------------------------------------------
16 //! Classic Monte Carlo Pathtracing algorithm for real global illumination
17 class SLPathtracer : public SLRaytracer
18 {
19 public:
20  SLPathtracer();
21  ~SLPathtracer() { SL_LOG("Destructor : ~SLPathtracer"); }
22 
23  // classic ray tracer functions
25  void renderSlices(bool isMainThread,
26  SLint currentSample,
27  SLuint threadNum);
28  SLCol4f trace(SLRay* ray, SLbool em);
29  SLCol4f shade(SLRay* ray, SLCol4f* mat);
30  void saveImage();
31 
32  // Setters
33  void calcDirect(SLbool di) { _calcDirect = di; }
34  void calcIndirect(SLbool ii) { _calcIndirect = ii; }
35 
36  // Getters
37  SLbool calcDirect() const { return _calcDirect; }
38  SLbool calcIndirect() const { return _calcIndirect; }
39 
40 private:
41  function<void(bool, int, SLuint)> renderSlicesPTAsync;
42 
43  SLbool _calcDirect; //!< flag to calculate direct illumination
44  SLbool _calcIndirect; //!< flag to calculate indirect illumination
45 };
46 //-----------------------------------------------------------------------------
47 #endif
#define SL_LOG(...)
Definition: SL.h:233
unsigned int SLuint
Definition: SL.h:171
bool SLbool
Definition: SL.h:175
int SLint
Definition: SL.h:170
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
Classic Monte Carlo Pathtracing algorithm for real global illumination.
Definition: SLPathtracer.h:18
SLbool _calcIndirect
flag to calculate indirect illumination
Definition: SLPathtracer.h:44
SLCol4f shade(SLRay *ray, SLCol4f *mat)
SLbool render(SLSceneView *sv)
void calcDirect(SLbool di)
Definition: SLPathtracer.h:33
SLbool calcIndirect() const
Definition: SLPathtracer.h:38
SLbool _calcDirect
flag to calculate direct illumination
Definition: SLPathtracer.h:43
void renderSlices(bool isMainThread, SLint currentSample, SLuint threadNum)
void calcIndirect(SLbool ii)
Definition: SLPathtracer.h:34
void saveImage()
Saves the current PT image as PNG image.
SLbool calcDirect() const
Definition: SLPathtracer.h:37
function< void(bool, int, SLuint)> renderSlicesPTAsync
Definition: SLPathtracer.h:41
SLCol4f trace(SLRay *ray, SLbool em)
Ray class with ray and intersection properties.
Definition: SLRay.h:40
SLRaytracer hold all the methods for Whitted style Ray Tracing.
Definition: SLRaytracer.h:57
SceneView class represents a dynamic real time 3D view onto the scene.
Definition: SLSceneView.h:69