ModifiedPhongBSDF Class Reference
Physically-correct modified phong model for glossy/specular surfaces, defined at a single point on a surface in 3-space. The modified phong model has two inputs: Kd, and Ks in [0, 1] subject to Kd + Ks <= 1, where Kd and Ks represent the diffuse and specular reflectivity of the surface respectively (fraction of incoming energy that is reflected diffusely/specularly). A third input, n, represents the specular shininess of the surface, where higher values of n correspond to tighter / sharper specular highlights, and lower values of n correspond to wider / glossier highlights. More...
#include <ModifiedPhongBSDF.h>

Public Member Functions | |
Constructors | |
| ModifiedPhongBSDF (SurfacePoint &pt, Material *parent=NULL) | |
| virtual | ~ModifiedPhongBSDF () |
Initialization | |
| virtual void | init () |
| Performs any initialization that may be necessary before beginning to sample this BSDF. | |
Main usage interface | |
| 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'. | |
Protected Attributes | |
| SpectralSampleSet | m_kd |
| SpectralSampleSet | m_ks |
| SpectralSampleSet | m_n |
| real_t | m_kda |
| real_t | m_ksa |
| real_t | m_na |
Detailed Description
Physically-correct modified phong model for glossy/specular surfaces, defined at a single point on a surface in 3-space. The modified phong model has two inputs: Kd, and Ks in [0, 1] subject to Kd + Ks <= 1, where Kd and Ks represent the diffuse and specular reflectivity of the surface respectively (fraction of incoming energy that is reflected diffusely/specularly). A third input, n, represents the specular shininess of the surface, where higher values of n correspond to tighter / sharper specular highlights, and lower values of n correspond to wider / glossier highlights.
- Date:
- Fall 2008
- Note:
- For more information, please see: E. Lafortune and Y. Willems. Using the modified Phong reflectance model for physically based rendering. Technical Report CW197, Dept of Computer Science, K.U. Leuven, 1994.
- Parameters:
-
kd - SpectralSampleSet which scales / attenuates the overall reflectance of the material (diffuse albedo) ks - SpectralSampleSet which scales / attenuates the overall reflectance of the material (specular albedo) n - Wavelength-dependent shininess exponent
- Note:
- Also known as modified Blinn-Phong model
Definition at line 42 of file ModifiedPhongBSDF.h.
Constructor & Destructor Documentation
| ModifiedPhongBSDF::ModifiedPhongBSDF | ( | SurfacePoint & | pt, | |
| Material * | parent = NULL | |||
| ) | [inline, explicit] |
Definition at line 47 of file ModifiedPhongBSDF.h.
| virtual ModifiedPhongBSDF::~ModifiedPhongBSDF | ( | ) | [inline, virtual] |
Definition at line 52 of file ModifiedPhongBSDF.h.
Member Function Documentation
| void ModifiedPhongBSDF::init | ( | ) | [virtual] |
Performs any initialization that may be necessary before beginning to sample this BSDF.
- Note:
- default implementation is empty
Reimplemented from BSDF.
Definition at line 47 of file ModifiedPhongBSDF.cpp.
| Event ModifiedPhongBSDF::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 82 of file ModifiedPhongBSDF.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 129 of file ModifiedPhongBSDF.cpp.
| SpectralSampleSet ModifiedPhongBSDF::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 163 of file ModifiedPhongBSDF.cpp.
Member Data Documentation
SpectralSampleSet ModifiedPhongBSDF::m_kd [protected] |
Definition at line 77 of file ModifiedPhongBSDF.h.
SpectralSampleSet ModifiedPhongBSDF::m_ks [protected] |
Definition at line 78 of file ModifiedPhongBSDF.h.
SpectralSampleSet ModifiedPhongBSDF::m_n [protected] |
Definition at line 79 of file ModifiedPhongBSDF.h.
real_t ModifiedPhongBSDF::m_kda [protected] |
Definition at line 81 of file ModifiedPhongBSDF.h.
real_t ModifiedPhongBSDF::m_ksa [protected] |
Definition at line 82 of file ModifiedPhongBSDF.h.
real_t ModifiedPhongBSDF::m_na [protected] |
Definition at line 83 of file ModifiedPhongBSDF.h.
The documentation for this class was generated from the following files:
Generated on 28 Feb 2009 for Milton by
1.5.6