/******************************************************************/ /* LambertianBRDF.h */ /* ----------------------- */ /* */ /* Defines a very simple Lambertian BRDF material type that you */ /* can use with the BRDFMaterial class to get simple diffuse */ /* surfaces. */ /* */ /* Chris Wyman (4/9/2006) */ /******************************************************************/ #ifndef LAMBERTIANBRDF_H #define LAMBERTIANBRDF_H #include "DataTypes/Color.h" #include "DataTypes/Vector.h" #include "DataTypes/Texture.h" #include "Utils/TextParsing.h" #include "Utils/Random.h" #include "Materials/BRDF.h" #include #include #include class Scene; class LambertianBRDF : public BRDF { Color albedo; public: LambertianBRDF() : albedo(Color::White()) {} LambertianBRDF( FILE *f, Scene *s ); // This function returns the BRDF given the directions to the viewer and to the light. The ray structure // can be used to get information about the hitpoint, and perhaps other relevent information, e.g. the // surface parameterization virtual Color SampleBRDF( const Ray &r, const Vector &toViewer, const Vector &incidentLight ) const; // This function returns a random vector sampled (somehow) over the hemisphere virtual Vector RandomlySelectOutgoingVector( Random *rng, const Vector &normVec ) const; // Given the random vector from above, return the probability of selecting this vector. // NOTE: One could consider incorporating this function with RandomlySelectOutgoingVector, by // returning the probability in an additional parameter. That is a little less clean, // but it probably eliminates duplicate computations that would be needed for the // GetProbabilityOfSampling method with more complex sampling schemes. virtual float GetProbabilityOfSampling( const Vector &normVec, const Vector &sampleVec ) const; }; #endif