00001 00002 /* 00003 pbrt source code Copyright(c) 1998-2010 Matt Pharr and Greg Humphreys. 00004 00005 This file is part of pbrt. 00006 00007 pbrt is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. Note that the text contents of 00011 the book "Physically Based Rendering" are *not* licensed under the 00012 GNU GPL. 00013 00014 pbrt is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program. If not, see <http://www.gnu.org/licenses/>. 00021 00022 */ 00023 00024 #if defined(_MSC_VER) 00025 #pragma once 00026 #endif 00027 00028 #ifndef PBRT_MATERIALS_SUBSTRATE_H 00029 #define PBRT_MATERIALS_SUBSTRATE_H 00030 00031 // materials/substrate.h* 00032 #include "pbrt.h" 00033 #include "material.h" 00034 00035 // SubstrateMaterial Declarations 00036 class SubstrateMaterial : public Material { 00037 public: 00038 // SubstrateMaterial Public Methods 00039 SubstrateMaterial(Reference<Texture<Spectrum> > kd, Reference<Texture<Spectrum> > ks, 00040 Reference<Texture<float> > u, Reference<Texture<float> > v, 00041 Reference<Texture<float> > bump) { 00042 Kd = kd; 00043 Ks = ks; 00044 nu = u; 00045 nv = v; 00046 bumpMap = bump; 00047 } 00048 BSDF *GetBSDF(const DifferentialGeometry &dgGeom, const DifferentialGeometry &dgShading, MemoryArena &arena) const; 00049 private: 00050 // SubstrateMaterial Private Data 00051 Reference<Texture<Spectrum> > Kd, Ks; 00052 Reference<Texture<float> > nu, nv; 00053 Reference<Texture<float> > bumpMap; 00054 }; 00055 00056 00057 SubstrateMaterial *CreateSubstrateMaterial(const Transform &xform, 00058 const TextureParams &mp); 00059 00060 #endif // PBRT_MATERIALS_SUBSTRATE_H