BSDF.h File Reference
Abstract representation of a BSDF defined at a single point on a surface in 3-space. More...
#include <core/SurfacePoint.h>
#include <utils/SpectralSampleSet.h>
#include <stats/Sampler.h>
#include <shapes/Shape.h>
#include <common/image/Image.h>
Go to the source code of this file.
Classes | |
| class | BSDF |
| Abstract representation of a BSDF defined at a single point on a surface in 3-space. More... | |
Detailed Description
Abstract representation of a BSDF defined at a single point on a surface in 3-space.
- Date:
- Fall 2008
Physically valid BRDFs have several basic properties or consraints, namely reciprocity and conservation of energy. Reciprocity means that BRDFs are symmetric: fr(wi->wo) = fr(wo->wi). For this reason, it is common to make the symmetric explicit in the notation by instead writing fr(wi<->wo) in the case of BRDFs or fs(wi<->wo) in the case of BSDFs. Conservation of energy states that a surface should not reflect more energy than it receives. Formally this can be stated as the integral of fr(wi->wo) over the positive hemisphere at any point with respect to a projected solid angle measure has to be less than or equal to one for all possible incident vectors, wi.
Example usage:
SurfacePoint pt;
const real_t t = m_scene->getIntersection(ray, pt);
// lazily initialize SurfacePoint and return if no intersection
if (!pt.init(ray, t))
return; // ray didn't hit anything (t == INFINITY)
// sample the BSDF for an exitant direction
const Event &event = pt.bsdf->sample();
const Vector3 &wo = event;
if (wo == Vector3::zero())
return; // invalid exitant direction
// evaluate BSDF in the given exitant direction and divide by probability
// with which we sampled that direction
const real_t pdf = pt.bsdf->getPdf(event);
const SpectralSampleSet &fs = pt.bsdf->getBSDF(wo) / pdf;
// ... trace another ray in direction 'wo' ...
Definition in file BSDF.h.
Generated on 28 Feb 2009 for Milton by
1.5.6