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_INTEGRATORS_DIRECTLIGHTING_H
00029 #define PBRT_INTEGRATORS_DIRECTLIGHTING_H
00030
00031
00032 #include "pbrt.h"
00033 #include "integrator.h"
00034 #include "scene.h"
00035
00036
00037 enum LightStrategy { SAMPLE_ALL_UNIFORM, SAMPLE_ONE_UNIFORM };
00038 class DirectLightingIntegrator : public SurfaceIntegrator {
00039 public:
00040
00041 DirectLightingIntegrator(LightStrategy ls = SAMPLE_ALL_UNIFORM, int md = 5);
00042 ~DirectLightingIntegrator();
00043 Spectrum Li(const Scene *scene, const Renderer *renderer,
00044 const RayDifferential &ray, const Intersection &isect,
00045 const Sample *sample, RNG &rng, MemoryArena &arena) const;
00046 void RequestSamples(Sampler *sampler, Sample *sample, const Scene *scene);
00047 private:
00048
00049 LightStrategy strategy;
00050 int maxDepth;
00051
00052
00053 LightSampleOffsets *lightSampleOffsets;
00054 BSDFSampleOffsets *bsdfSampleOffsets;
00055 int lightNumOffset;
00056 };
00057
00058
00059 DirectLightingIntegrator *CreateDirectLightingIntegrator(const ParamSet ¶ms);
00060
00061 #endif // PBRT_INTEGRATORS_DIRECTLIGHTING_H