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 "transport.h"
00026 #include "scene.h"
00027
00028 namespace lux
00029 {
00030
00031
00032 class PathIntegrator : public SurfaceIntegrator {
00033 public:
00034
00035 enum LightStrategy { SAMPLE_ALL_UNIFORM, SAMPLE_ONE_UNIFORM,
00036 SAMPLE_AUTOMATIC
00037 };
00038 enum RRStrategy { RR_EFFICIENCY, RR_PROBABILITY, RR_NONE };
00039
00040
00041 PathIntegrator(LightStrategy st, RRStrategy rst, int md, float cp, bool ie) {
00042 lightStrategy = st;
00043 rrStrategy = rst;
00044 maxDepth = md;
00045 continueProbability = cp;
00046 bufferId = -1;
00047 includeEnvironment = ie;
00048 }
00049 virtual ~PathIntegrator() { }
00050 virtual int Li(const TsPack *tspack, const Scene *scene, const Sample *sample) const;
00051 virtual void RequestSamples(Sample *sample, const Scene *scene);
00052 virtual void Preprocess(const TsPack *tspack, const Scene *scene);
00053 static SurfaceIntegrator *CreateSurfaceIntegrator(const ParamSet ¶ms);
00054 private:
00055
00056 LightStrategy lightStrategy;
00057 RRStrategy rrStrategy;
00058 int maxDepth;
00059 float continueProbability;
00060
00061 int sampleOffset, bufferId;
00062 bool includeEnvironment;
00063 };
00064
00065 }
00066