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