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_DISTANT_H
00029 #define PBRT_LIGHTS_DISTANT_H
00030
00031
00032 #include "pbrt.h"
00033 #include "light.h"
00034 #include "shape.h"
00035 #include "scene.h"
00036
00037
00038 class DistantLight : public Light {
00039 public:
00040
00041 DistantLight(const Transform &light2world, const Spectrum &radiance, const Vector &dir);
00042 bool IsDeltaLight() const { return true; }
00043 Spectrum Sample_L(const Point &p, float pEpsilon, const LightSample &ls,
00044 float time, Vector *wi, float *pdf, VisibilityTester *) const;
00045 Spectrum Power(const Scene *) const;
00046 Spectrum Sample_L(const Scene *scene, const LightSample &ls, float u1,
00047 float u2, float time, Ray *ray, Normal *Ns, float *pdf) const;
00048 float Pdf(const Point &, const Vector &) const;
00049 private:
00050
00051 Vector lightDir;
00052 Spectrum L;
00053 };
00054
00055
00056 DistantLight *CreateDistantLight(const Transform &light2world,
00057 const ParamSet ¶mSet);
00058
00059 #endif // PBRT_LIGHTS_DISTANT_H