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_PHOTONMAP_H
00029 #define PBRT_INTEGRATORS_PHOTONMAP_H
00030
00031
00032 #include "pbrt.h"
00033 #include "integrator.h"
00034 #include "kdtree.h"
00035
00036 struct Photon;
00037 struct RadiancePhoton;
00038 struct ClosePhoton;
00039 struct PhotonProcess;
00040 struct RadiancePhotonProcess;
00041
00042
00043
00044 class PhotonIntegrator : public SurfaceIntegrator {
00045 public:
00046
00047 PhotonIntegrator(int ncaus, int nindir, int nLookup, int maxspecdepth,
00048 int maxphotondepth, float maxdist, bool finalGather, int gatherSamples,
00049 float ga);
00050 ~PhotonIntegrator();
00051 Spectrum Li(const Scene *scene, const Renderer *renderer,
00052 const RayDifferential &ray, const Intersection &isect, const Sample *sample,
00053 RNG &rng, MemoryArena &arena) const;
00054 void RequestSamples(Sampler *sampler, Sample *sample, const Scene *scene);
00055 void Preprocess(const Scene *scene, const Camera *camera, const Renderer *renderer);
00056 private:
00057
00058 friend class PhotonShootingTask;
00059
00060
00061 uint32_t nCausticPhotonsWanted, nIndirectPhotonsWanted, nLookup;
00062 float maxDistSquared;
00063 int maxSpecularDepth, maxPhotonDepth;
00064 bool finalGather;
00065 int gatherSamples;
00066 float cosGatherAngle;
00067
00068
00069 LightSampleOffsets *lightSampleOffsets;
00070 BSDFSampleOffsets *bsdfSampleOffsets;
00071 BSDFSampleOffsets bsdfGatherSampleOffsets, indirGatherSampleOffsets;
00072 int nCausticPaths, nIndirectPaths;
00073 KdTree<Photon> *causticMap;
00074 KdTree<Photon> *indirectMap;
00075 KdTree<RadiancePhoton> *radianceMap;
00076 };
00077
00078
00079 PhotonIntegrator *CreatePhotonMapSurfaceIntegrator(const ParamSet ¶ms);
00080
00081 #endif // PBRT_INTEGRATORS_PHOTONMAP_H