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 #include "mc.h"
00028 #include "sampling.h"
00029
00030 namespace lux
00031 {
00032
00033
00034 struct VirtualLight {
00035 VirtualLight() { }
00036 VirtualLight(const Point &pp, const Normal &nn, const Spectrum &le)
00037 : p(pp), n(nn), Le(le) { }
00038 Point p;
00039 Normal n;
00040 Spectrum Le;
00041 };
00042
00043 class IGIIntegrator : public SurfaceIntegrator {
00044 public:
00045
00046 IGIIntegrator(int nl, int ns, float md, float rrt, float is);
00047 Spectrum Li(const Scene *scene, const RayDifferential &ray,
00048 const Sample *sample, float *alpha) const;
00049 void RequestSamples(Sample *sample, const Scene *scene);
00050 void Preprocess(const Scene *);
00051 virtual IGIIntegrator* clone() const;
00052 IntegrationSampler* HasIntegrationSampler(IntegrationSampler *is) { return NULL; };
00053 static SurfaceIntegrator *CreateSurfaceIntegrator(const ParamSet ¶ms);
00054 private:
00055
00056 u_int nLightPaths, nLightSets;
00057 vector<VirtualLight> *virtualLights;
00058 mutable int specularDepth;
00059 int maxSpecularDepth;
00060 float minDist2, rrThreshold, indirectScale;
00061 int vlSetOffset;
00062
00063 int *lightSampleOffset, lightNumOffset;
00064 int *bsdfSampleOffset, *bsdfComponentOffset;
00065 };
00066
00067 }
00068