/******************************************************************/ /* BRDF.h */ /* ----------------------- */ /* */ /* A base class for BRDFs. A BRDF encapsulates data about a */ /* a material's reflectance so that a single BRDFMaterial */ /* class can be used to render a variety of material types. */ /* */ /* Chris Wyman (4/9/2006) */ /******************************************************************/ #ifndef BRDF_H #define BRDF_H #include "DataTypes/Color.h" #include "DataTypes/Vector.h" #include "Utils/TextParsing.h" #include "Utils/Random.h" #include "Core/Ray.h" #include #include #include class Scene; class BRDF { public: BRDF() {} BRDF( FILE *f, Scene *s ) { printf("Virtual constructor BRDF( FILE *f ) called. This is not implemented!\n"); } // 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 = 0; // This function returns a random vector sampled (somehow) over the hemisphere virtual Vector RandomlySelectOutgoingVector( Random *rng, const Vector &normVec ) const = 0; // 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 = 0; }; #endif