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_POINT_H
00029 #define PBRT_LIGHTS_POINT_H
00030
00031
00032 #include "pbrt.h"
00033 #include "light.h"
00034 #include "shape.h"
00035
00036
00037 class PointLight : public Light {
00038 public:
00039
00040 PointLight(const Transform &light2world, const Spectrum &intensity);
00041 Spectrum Sample_L(const Point &p, float pEpsilon, const LightSample &ls,
00042 float time, Vector *wi, float *pdf, VisibilityTester *vis) const;
00043 Spectrum Power(const Scene *) const;
00044 bool IsDeltaLight() const { return true; }
00045 Spectrum Sample_L(const Scene *scene, const LightSample &ls, float u1,
00046 float u2, float time, Ray *ray, Normal *Ns, float *pdf) const;
00047 float Pdf(const Point &, const Vector &) const;
00048 void SHProject(const Point &p, float pEpsilon, int lmax, const Scene *scene,
00049 bool computeLightVisibility, float time, RNG &rng, Spectrum *coeffs) const;
00050 private:
00051
00052 Point lightPos;
00053 Spectrum Intensity;
00054 };
00055
00056
00057 PointLight *CreatePointLight(const Transform &light2world,
00058 const ParamSet ¶mSet);
00059
00060 #endif // PBRT_LIGHTS_POINT_H