00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef PBRT_TRANSPORT_H
00025 #define PBRT_TRANSPORT_H
00026
00027 #include "pbrt.h"
00028 #include "primitive.h"
00029 #include "color.h"
00030 #include "light.h"
00031 #include "reflection.h"
00032 #include "sampling.h"
00033 #include "material.h"
00034
00035 class COREDLL Integrator {
00036 public:
00037
00038 virtual ~Integrator();
00039 virtual Spectrum Li(const Scene *scene,
00040 const RayDifferential &ray,
00041 const Sample *sample,
00042 float *alpha) const = 0;
00043 virtual void Preprocess(const Scene *scene) {
00044 }
00045 virtual void RequestSamples(Sample *sample,
00046 const Scene *scene) {
00047 }
00048 };
00049 class SurfaceIntegrator : public Integrator {
00050 };
00051 COREDLL Spectrum UniformSampleAllLights(const Scene *scene,
00052 const Point &p, const Normal &n, const Vector &wo,
00053 BSDF *bsdf, const Sample *sample,
00054 int *lightSampleOffset, int *bsdfSampleOffset,
00055 int *bsdfComponentOffset);
00056 COREDLL Spectrum UniformSampleOneLight(const Scene *scene, const Point &p,
00057 const Normal &n, const Vector &wo, BSDF *bsdf,
00058 const Sample *sample, int lightSampleOffset = -1,
00059 int lightNumOffset = -1, int bsdfSampleOffset = -1,
00060 int bsdfComponentOffset = -1);
00061 COREDLL Spectrum WeightedSampleOneLight(const Scene *scene, const Point &p,
00062 const Normal &n, const Vector &wo, BSDF *bsdf,
00063 const Sample *sample, int lightSampleOffset, int lightNumOffset,
00064 int bsdfSampleOffset, int bsdfComponentOffset, float *&avgY,
00065 float *&avgYsample, float *&cdf, float &overallAvgY);
00066 #endif // PBRT_TRANSPORT_H