YafaRay Core  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
photonintegr.h
Go to the documentation of this file.
1 
2 #ifndef Y_PHOTONINTEGR_H
3 #define Y_PHOTONINTEGR_H
4 
5 #include <yafray_config.h>
6 #include <core_api/environment.h>
7 #include <core_api/material.h>
8 #include <core_api/background.h>
9 #include <core_api/light.h>
10 #include <core_api/imagefilm.h>
11 #include <core_api/camera.h>
12 #include <core_api/mcintegrator.h>
13 #include <yafraycore/photon.h>
14 #include <yafraycore/monitor.h>
15 #include <yafraycore/timer.h>
16 #include <yafraycore/spectrum.h>
17 #include <utilities/sample_utils.h>
18 
19 
21 
23 {
26 
27  std::vector<radData_t> rad_points;
28  std::vector<photon_t> radianceVec;
30  volatile int fetched;
31  std::mutex mutx;
32 };
33 
35 {
36  public:
37  photonIntegrator_t(unsigned int dPhotons, unsigned int cPhotons, bool transpShad=false, int shadowDepth = 4, float dsRad = 0.1f, float cRad = 0.01f);
39  virtual bool preprocess();
40  virtual colorA_t integrate(renderState_t &state, diffRay_t &ray, colorPasses_t &colorPasses, int additionalDepth = 0) const;
41  static integrator_t* factory(paraMap_t &params, renderEnvironment_t &render);
42  virtual void preGatherWorker(preGatherData_t * gdata, float dsRad, int nSearch);
43  virtual void causticWorker(photonMap_t * causticMap, int threadID, const scene_t *scene, unsigned int nCausPhotons, const pdf1D_t *lightPowerD, int numCLights, const std::string &integratorName, const std::vector<light_t *> &tmplights, int causDepth, progressBar_t *pb, int pbStep, unsigned int &totalPhotonsShot, int maxBounces);
44  virtual void diffuseWorker(photonMap_t * diffuseMap, int threadID, const scene_t *scene, unsigned int nDiffusePhotons, const pdf1D_t *lightPowerD, int numDLights, const std::string &integratorName, const std::vector<light_t *> &tmplights, progressBar_t *pb, int pbStep, unsigned int &totalPhotonsShot, int maxBounces, bool finalGather, preGatherData_t &pgdat);
45  virtual void photonMapKdTreeWorker(photonMap_t * photonMap);
46 
47  protected:
48  color_t finalGathering(renderState_t &state, const surfacePoint_t &sp, const vector3d_t &wo, colorPasses_t &colorPasses) const;
49 
50  void enableCaustics(const bool caustics) { usePhotonCaustics = caustics; }
51  void enableDiffuse(const bool diffuse) { usePhotonDiffuse = diffuse; }
52 
54  bool finalGather, showMap;
55  bool prepass;
56  unsigned int nDiffusePhotons;
59  float dsRadius;
60  float lookupRad;
61  float gatherDist;
62  friend class prepassWorker_t;
63 };
64 
66 
67 #endif // Y_PHOTONINTEGR_H
float dsRadius
diffuse search radius
Definition: photonintegr.h:59
unsigned int nDiffusePhotons
Definition: photonintegr.h:56
volatile int fetched
Definition: photonintegr.h:30
#define __BEGIN_YAFRAY
std::mutex mutx
Definition: photonintegr.h:31
Progress bar abstract class with pure virtual members.
Definition: monitor.h:9
Definition: scene.h:143
std::vector< photon_t > radianceVec
Definition: photonintegr.h:28
photonMap_t * diffuseMap
Definition: photonintegr.h:25
virtual colorA_t integrate(renderState_t &state, diffRay_t &ray, colorPasses_t &colPasses, int additionalDepth=0) const =0
#define YAFRAYPLUGIN_EXPORT
Definition: color.h:49
progressBar_t * pbar
Definition: photonintegr.h:29
std::vector< radData_t > rad_points
Definition: photonintegr.h:27
virtual bool preprocess()
Definition: integrator.h:69
void enableDiffuse(const bool diffuse)
Definition: photonintegr.h:51
virtual void causticWorker(photonMap_t *causticMap, int threadID, const scene_t *scene, unsigned int nCausPhotons, pdf1D_t *lightPowerD, int numLights, const std::string &integratorName, const std::vector< light_t * > &causLights, int causDepth, progressBar_t *pb, int pbStep, unsigned int &totalPhotonsShot)
float gatherDist
minimum distance to terminate path tracing (unless gatherBounces is reached)
Definition: photonintegr.h:61
preGatherData_t(photonMap_t *dm)
Definition: photonintegr.h:24
Definition: ray.h:24
float lookupRad
square radius to lookup radiance photons, as infinity is no such good idea ;)
Definition: photonintegr.h:60
void enableCaustics(const bool caustics)
Definition: photonintegr.h:50
bool usePhotonDiffuse
enable/disable diffuse photon processing
Definition: photonintegr.h:53
#define __END_YAFRAY