00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "lux.h"
00025 #include "light.h"
00026 #include "transport.h"
00027 #include "scene.h"
00028
00029 namespace lux
00030 {
00031
00032
00033
00034 class DistributedPath : public SurfaceIntegrator {
00035 public:
00036
00037 enum LightStrategy { SAMPLE_ALL_UNIFORM, SAMPLE_ONE_UNIFORM,
00038 SAMPLE_AUTOMATIC
00039 };
00040
00041
00042 DistributedPath(LightStrategy st, bool da, int ds, bool dd, bool dg, bool ida, int ids, bool idd, bool idg,
00043 int drd, int drs, int dtd, int dts, int grd, int grs, int gtd, int gts, int srd, int std,
00044 bool drer, float drert, bool drfr, float drfrt,
00045 bool grer, float grert, bool grfr, float grfrt);
00046 virtual ~DistributedPath() { }
00047
00048 virtual int Li(const TsPack *tspack, const Scene *scene, const Sample *sample) const;
00049 virtual void RequestSamples(Sample *sample, const Scene *scene);
00050 virtual void Preprocess(const TsPack *tspack, const Scene *scene);
00051 static SurfaceIntegrator *CreateSurfaceIntegrator(const ParamSet ¶ms);
00052
00053 private:
00054 void LiInternal(const TsPack *tspack, const Scene *scene, const RayDifferential &ray,
00055 const Sample *sample, vector<SWCSpectrum> &L, float *alpha, float *zdepth, int rayDepth, bool includeEmit, int &nrContribs) const;
00056 void Reject(const TsPack *tspack, vector< vector<SWCSpectrum> > &LL, vector<SWCSpectrum> &L, float rejectrange) const;
00057
00058
00059 LightStrategy lightStrategy;
00060 bool directAll, directDiffuse, directGlossy,
00061 indirectAll, indirectDiffuse, indirectGlossy;
00062 int directSamples, indirectSamples;
00063 int diffusereflectDepth, diffusereflectSamples, diffuserefractDepth, diffuserefractSamples, glossyreflectDepth, glossyreflectSamples,
00064 glossyrefractDepth, glossyrefractSamples, specularreflectDepth, specularrefractDepth, maxDepth;
00065
00066
00067 int sampleOffset, bufferId;
00068 int lightSampleOffset, lightNumOffset, bsdfSampleOffset, bsdfComponentOffset;
00069 int indirectlightSampleOffset, indirectlightNumOffset, indirectbsdfSampleOffset, indirectbsdfComponentOffset;
00070 int diffuse_reflectSampleOffset, diffuse_reflectComponentOffset, indirectdiffuse_reflectSampleOffset, indirectdiffuse_reflectComponentOffset;
00071 int diffuse_refractSampleOffset, diffuse_refractComponentOffset, indirectdiffuse_refractSampleOffset, indirectdiffuse_refractComponentOffset;
00072 int glossy_reflectSampleOffset, glossy_reflectComponentOffset, indirectglossy_reflectSampleOffset, indirectglossy_reflectComponentOffset;
00073 int glossy_refractSampleOffset, glossy_refractComponentOffset, indirectglossy_refractSampleOffset, indirectglossy_refractComponentOffset;
00074
00075 bool diffusereflectReject, diffuserefractReject, glossyreflectReject, glossyrefractReject;
00076 float diffusereflectReject_thr, diffuserefractReject_thr, glossyreflectReject_thr, glossyrefractReject_thr;
00077 };
00078
00079 }