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_MATERIALS_KDSUBSURFACE_H
00029 #define PBRT_MATERIALS_KDSUBSURFACE_H
00030
00031
00032 #include "pbrt.h"
00033 #include "material.h"
00034
00035
00036 class KdSubsurfaceMaterial : public Material {
00037 public:
00038
00039 KdSubsurfaceMaterial(Reference<Texture<Spectrum> > kd,
00040 Reference<Texture<Spectrum> > kr,
00041 Reference<Texture<float> > mfp,
00042 Reference<Texture<float> > e,
00043 Reference<Texture<float> > bump) {
00044 Kd = kd;
00045 Kr = kr;
00046 meanfreepath = mfp;
00047 eta = e;
00048 bumpMap = bump;
00049 }
00050 BSDF *GetBSDF(const DifferentialGeometry &dgGeom,
00051 const DifferentialGeometry &dgShading,
00052 MemoryArena &arena) const;
00053 BSSRDF *GetBSSRDF(const DifferentialGeometry &dgGeom,
00054 const DifferentialGeometry &dgShading,
00055 MemoryArena &arena) const;
00056 private:
00057
00058 Reference<Texture<Spectrum> > Kd, Kr;
00059 Reference<Texture<float> > meanfreepath, eta, bumpMap;
00060 };
00061
00062
00063 KdSubsurfaceMaterial *CreateKdSubsurfaceMaterial(const Transform &xform,
00064 const TextureParams &mp);
00065
00066 #endif // PBRT_MATERIALS_KDSUBSURFACE_H