00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "lux.h"
00025 #include "material.h"
00026
00027 namespace lux
00028 {
00029
00030
00031 class Glossy : public Material {
00032 public:
00033
00034 Glossy(boost::shared_ptr<Texture<SWCSpectrum> > kd, boost::shared_ptr<Texture<SWCSpectrum> > ks,
00035 boost::shared_ptr<Texture<SWCSpectrum> > ka, boost::shared_ptr<Texture<float> > i, boost::shared_ptr<Texture<float> > d,
00036 boost::shared_ptr<Texture<float> > u, boost::shared_ptr<Texture<float> > v,
00037 boost::shared_ptr<Texture<float> > bump, const CompositingParams &cp) {
00038 Kd = kd;
00039 Ks = ks;
00040 Ka = ka;
00041 index = i;
00042 depth = d;
00043 nu = u;
00044 nv = v;
00045 bumpMap = bump;
00046 compParams = new CompositingParams(cp);
00047 }
00048 virtual ~Glossy() { }
00049 virtual BSDF *GetBSDF(const TsPack *tspack, const DifferentialGeometry &dgGeom, const DifferentialGeometry &dgShading) const;
00050
00051 static Material * CreateMaterial(const Transform &xform, const TextureParams &mp);
00052 private:
00053
00054 boost::shared_ptr<Texture<SWCSpectrum> > Kd, Ks, Ka;
00055 boost::shared_ptr<Texture<float> > depth, index;
00056 boost::shared_ptr<Texture<float> > nu, nv;
00057 boost::shared_ptr<Texture<float> > bumpMap;
00058 };
00059
00060 }