AggregateBSDF Class Reference
Linear combination of different BSDF implementations, where the coefficients are determined either a priori (inherent property described in scenefile) or via a texture map lookup. More...
#include <AggregateBSDF.h>

Public Member Functions | |
Constructors | |
| AggregateBSDF (SurfacePoint &pt, Material *parent=NULL) | |
| virtual | ~AggregateBSDF () |
Initialization | |
| virtual void | init () |
| Initializes this aggregate BSDF for sampling by selecting one of the possible child BSDFs. | |
Main usage interface | |
| virtual void | setWi (const Vector3 &wi) |
| Sets the incident vector, wi, for this BSDF. All BSDF sampling is with respect to the current value of wi. | |
| virtual Event | sample () |
| Samples an exitent vector at the given surface point. | |
| virtual real_t | getPdf (const Event &event) |
| virtual SpectralSampleSet | getBSDF (const Vector3 &wi, const Vector3 &wo) |
| Evaluates the spectral BSDF at the given surface point with respect to the out vector, 'wo', at the underlying surface point and given incident vector, 'wi'. | |
| virtual bool | isSpecular (Event &event) const |
Protected Attributes | |
| BSDFList | m_bsdfs |
| unsigned | m_bsdf |
Detailed Description
Linear combination of different BSDF implementations, where the coefficients are determined either a priori (inherent property described in scenefile) or via a texture map lookup.
- Date:
- Fall 2008
Definition at line 29 of file AggregateBSDF.h.
Constructor & Destructor Documentation
| AggregateBSDF::AggregateBSDF | ( | SurfacePoint & | pt, | |
| Material * | parent = NULL | |||
| ) | [inline, explicit] |
Definition at line 34 of file AggregateBSDF.h.
| AggregateBSDF::~AggregateBSDF | ( | ) | [virtual] |
Definition at line 17 of file AggregateBSDF.cpp.
Member Function Documentation
| void AggregateBSDF::init | ( | ) | [virtual] |
Initializes this aggregate BSDF for sampling by selecting one of the possible child BSDFs.
Reimplemented from BSDF.
Definition at line 23 of file AggregateBSDF.cpp.
| void AggregateBSDF::setWi | ( | const Vector3 & | wi | ) | [virtual] |
Sets the incident vector, wi, for this BSDF. All BSDF sampling is with respect to the current value of wi.
Reimplemented from BSDF.
Definition at line 54 of file AggregateBSDF.cpp.
| Event AggregateBSDF::sample | ( | ) | [virtual] |
Samples an exitent vector at the given surface point.
- Returns:
- the sampled vector as a Vector3 wrapped in an Event object
- Note:
- returns Vector3::zero() if no exitent vector was sampled (to model a certain probability of absorption, for instance)
const Event &event = bsdf.sample();
const Vector3 &wo = event.getValue();
const real_t pd = bsdf.getPdf(event); // p(x) probability
const SpectralSampleSet &fs = bsdf.getBSDF(wo); // f(x) reflectivity
Implements BSDF.
Definition at line 61 of file AggregateBSDF.cpp.
- Returns:
- the probability density of having sampled the given out out vector
eventwith respect to whatever underlying sampling strategy is being used to sample the BSDF
- Note:
- probability density is assumed to be with respect to projected solid angle (the conversion from solid angle to projected solid angle involves dividing the solid angle density by the absolute value of the cosine of the angle between the local surface normal and the exitant vector in
event)
Implements BSDF.
Definition at line 66 of file AggregateBSDF.cpp.
| SpectralSampleSet AggregateBSDF::getBSDF | ( | const Vector3 & | wi, | |
| const Vector3 & | wo | |||
| ) | [virtual] |
Evaluates the spectral BSDF at the given surface point with respect to the out vector, 'wo', at the underlying surface point and given incident vector, 'wi'.
- Returns:
- the spectral radiance leaving in direction wo, per unit of irradiance arriving from wi (unitless fraction in [0, 1])
Implements BSDF.
Definition at line 73 of file AggregateBSDF.cpp.
| bool AggregateBSDF::isSpecular | ( | Event & | ) | const [virtual] |
- Returns:
- true iff this BSDF is non-zero over a set of solid angles with measure zero (measured with respect to solid angle)
- Note:
- a perfectly specular material has a dirac distribution for its reflectance, and therefore needs special consideration when sampling the BRDF for simulation purposes
the default implementation returns false because perfectly specular surfaces don't occur that often in real life, though they abound in computer graphics (due to their ease of simulation)
implementations are free to use the given Event's metadata to determine whether or not it represents a specular event
Reimplemented from BSDF.
Definition at line 77 of file AggregateBSDF.cpp.
Member Data Documentation
BSDFList AggregateBSDF::m_bsdfs [protected] |
Definition at line 70 of file AggregateBSDF.h.
unsigned AggregateBSDF::m_bsdf [protected] |
Definition at line 72 of file AggregateBSDF.h.
The documentation for this class was generated from the following files:
Generated on 28 Feb 2009 for Milton by
1.5.6