00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LUX_TRANSPORT_H
00024 #define LUX_TRANSPORT_H
00025
00026 #include "lux.h"
00027 #include "spectrum.h"
00028
00029 namespace lux
00030 {
00031
00032
00033 class Integrator {
00034 public:
00035
00036 virtual ~Integrator();
00037 virtual SWCSpectrum Li(const Scene *scene,
00038 const RayDifferential &ray,
00039 const Sample *sample,
00040 float *alpha) const = 0;
00041 virtual void Preprocess(const Scene *scene) {
00042 }
00043 virtual void RequestSamples(Sample *sample,
00044 const Scene *scene) {
00045 }
00046 };
00047 class SurfaceIntegrator : public Integrator {
00048 public:
00049 virtual bool IsFluxBased() {
00050 return false;
00051 }
00052
00053
00054
00055
00056
00057
00058
00059 };
00060 class VolumeIntegrator : public Integrator {
00061 public:
00062 virtual SWCSpectrum Transmittance(const Scene *scene,
00063 const Ray &ray, const Sample *sample,
00064 float *alpha) const = 0;
00065 };
00066 SWCSpectrum UniformSampleAllLights(const Scene *scene, const Point &p,
00067 const Normal &n, const Vector &wo, BSDF *bsdf,
00068 const Sample *sample, float *lightSample = NULL,
00069 float *lightNum = NULL, float *bsdfSample = NULL,
00070 float *bsdfComponent = NULL);
00071 SWCSpectrum UniformSampleAllLights(const Scene *scene,
00072 const Point &p, const Normal &n, const Vector &wo,
00073 BSDF *bsdf, const Sample *sample,
00074 int *lightSampleOffset, int *bsdfSampleOffset,
00075 int *bsdfComponentOffset);
00076 SWCSpectrum UniformSampleOneLight(const Scene *scene, const Point &p,
00077 const Normal &n, const Vector &wo, BSDF *bsdf,
00078 const Sample *sample, float *lightSample = NULL,
00079 float *lightNum = NULL, float *bsdfSample = NULL,
00080 float *bsdfComponent = NULL);
00081 SWCSpectrum WeightedSampleOneLight(const Scene *scene, const Point &p,
00082 const Normal &n, const Vector &wo, BSDF *bsdf,
00083 const Sample *sample, int lightSampleOffset, int lightNumOffset,
00084 int bsdfSampleOffset, int bsdfComponentOffset, float *&avgY,
00085 float *&avgYsample, float *&cdf, float &overallAvgY);
00086
00087 }
00088
00089 #endif // LUX_TRANSPORT_H