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_RENDERERS_SURFACEPOINTS_H
00029 #define PBRT_RENDERERS_SURFACEPOINTS_H
00030
00031
00032 #include "pbrt.h"
00033 #include "geometry.h"
00034 #include "renderer.h"
00035
00036
00037 struct SurfacePoint {
00038 SurfacePoint() { }
00039 SurfacePoint(const Point &pp, const Normal &nn, float a, float eps)
00040 : p(pp), n(nn), area(a), rayEpsilon(eps) { }
00041
00042 Point p;
00043 Normal n;
00044 float area, rayEpsilon;
00045 };
00046
00047
00048 class SurfacePointsRenderer : public Renderer {
00049 public:
00050
00051 SurfacePointsRenderer(float md, const Point &pc, float t,
00052 const string &fn)
00053 : minDist(md), time(t), pCamera(pc), filename(fn) { }
00054 void Render(const Scene *scene);
00055 Spectrum Li(const Scene *scene, const RayDifferential &ray,
00056 const Sample *sample, RNG &rng, MemoryArena &arena,
00057 Intersection *isect, Spectrum *T) const;
00058 Spectrum Transmittance(const Scene *scene, const RayDifferential &ray,
00059 const Sample *sample, RNG &rng, MemoryArena &arena) const;
00060 private:
00061
00062 float minDist, time;
00063 Point pCamera;
00064 string filename;
00065 friend void FindPoissonPointDistribution(const Point &pCamera, float time,
00066 float minDist, const Scene *scene, vector<SurfacePoint> *points);
00067 vector<SurfacePoint> points;
00068 };
00069
00070
00071 void FindPoissonPointDistribution(const Point &pCamera, float time, float minDist,
00072 const Scene *scene, vector<SurfacePoint> *points);
00073 SurfacePointsRenderer *CreateSurfacePointsRenderer(const ParamSet ¶ms,
00074 const Point &pCamera, float time);
00075
00076 #endif // PBRT_RENDERERS_SURFACEPOINTS_H