00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if defined(_MSC_VER)
00025 #pragma once
00026 #endif
00027
00028 #ifndef PBRT_LIGHTS_INFINITE_H
00029 #define PBRT_LIGHTS_INFINITE_H
00030
00031
00032 #include "pbrt.h"
00033 #include "light.h"
00034 #include "texture.h"
00035 #include "shape.h"
00036 #include "scene.h"
00037 #include "mipmap.h"
00038
00039
00040 class InfiniteAreaLight : public Light {
00041 public:
00042
00043 InfiniteAreaLight(const Transform &light2world, const Spectrum &power, int ns,
00044 const string &texmap);
00045 ~InfiniteAreaLight();
00046 Spectrum Power(const Scene *) const;
00047 bool IsDeltaLight() const { return false; }
00048 Spectrum Le(const RayDifferential &r) const;
00049 Spectrum Sample_L(const Point &p, float pEpsilon, const LightSample &ls,
00050 float time, Vector *wi, float *pdf, VisibilityTester *visibility) const;
00051 Spectrum Sample_L(const Scene *scene, const LightSample &ls, float u1, float u2,
00052 float time, Ray *ray, Normal *Ns, float *pdf) const;
00053 float Pdf(const Point &, const Vector &) const;
00054 void SHProject(const Point &p, float pEpsilon, int lmax, const Scene *scene,
00055 bool computeLightVis, float time, RNG &rng, Spectrum *coeffs) const;
00056 private:
00057
00058 MIPMap<RGBSpectrum> *radianceMap;
00059 Distribution2D *distribution;
00060 };
00061
00062
00063 InfiniteAreaLight *CreateInfiniteLight(const Transform &light2world,
00064 const ParamSet ¶mSet);
00065
00066 #endif // PBRT_LIGHTS_INFINITE_H