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
00027 namespace lux
00028 {
00029
00030
00031 class BidirIntegrator : public SurfaceIntegrator {
00032 public:
00033
00034 enum LightStrategy { SAMPLE_ALL_UNIFORM, SAMPLE_ONE_UNIFORM,
00035 SAMPLE_AUTOMATIC
00036 };
00037
00038
00039 BidirIntegrator(int ed, int ld, float et, float lt, LightStrategy ls,
00040 bool d) :
00041 maxEyeDepth(ed), maxLightDepth(ld),
00042 eyeThreshold(et), lightThreshold(lt),
00043 lightStrategy(ls), debug(d) {
00044 eyeBufferId = -1;
00045 lightBufferId = -1;
00046 }
00047 virtual ~BidirIntegrator() { }
00048
00049 virtual int Li(const TsPack *tspack, const Scene *scene, const Sample *sample) const;
00050 virtual void RequestSamples(Sample *sample, const Scene *scene);
00051 virtual void Preprocess(const TsPack *tspack, const Scene *scene);
00052 static SurfaceIntegrator *CreateSurfaceIntegrator(const ParamSet ¶ms);
00053 int maxEyeDepth, maxLightDepth;
00054 float eyeThreshold, lightThreshold;
00055 int sampleEyeOffset, sampleLightOffset;
00056 int eyeBufferId, lightBufferId;
00057 private:
00058
00059 LightStrategy lightStrategy;
00060 int lightNumOffset, lightComponentOffset;
00061 int lightPosOffset, lightDirOffset, sampleDirectOffset;
00062 bool debug;
00063 };
00064
00065 }
00066