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_GLOSSYPRT_H
00029 #define PBRT_INTEGRATORS_GLOSSYPRT_H
00030
00031
00032 #include "pbrt.h"
00033 #include "integrator.h"
00034
00035
00036 class GlossyPRTIntegrator : public SurfaceIntegrator {
00037 public:
00038
00039 GlossyPRTIntegrator(const Spectrum &kd, const Spectrum &ks,
00040 float rough, int lm, int ns)
00041 : Kd(kd), Ks(ks), roughness(rough), lmax(lm),
00042 nSamples(RoundUpPow2(ns)) {
00043 c_in = B = NULL;
00044 }
00045 ~GlossyPRTIntegrator();
00046 void Preprocess(const Scene *scene, const Camera *camera, const Renderer *renderer);
00047 void RequestSamples(Sampler *sampler, Sample *sample, const Scene *scene);
00048 Spectrum Li(const Scene *scene, const Renderer *,
00049 const RayDifferential &ray, const Intersection &isect,
00050 const Sample *sample, RNG &rng, MemoryArena &arena) const;
00051 private:
00052
00053 const Spectrum Kd, Ks;
00054 const float roughness;
00055 const int lmax, nSamples;
00056 Spectrum *c_in;
00057 Spectrum *B;
00058 };
00059
00060
00061 GlossyPRTIntegrator *CreateGlossyPRTIntegratorSurfaceIntegrator(const ParamSet ¶ms);
00062
00063 #endif // PBRT_INTEGRATORS_GLOSSYPRT_H