LambertianBRDF Class Reference

#include <LambertianBRDF.h>

Inheritance diagram for LambertianBRDF:

DiffuseBRDF BRDF ESGObject List of all members.

Public Types

enum  RetVal {
  NONZERO_CONTRIB = 1, BAD_PARAMS = 2, NL_NEGATIVE = 3, NV_NEGATIVE = 4,
  NL_OR_NV_NEGATIVE = 5, ZERO_CONTRIB = 6
}

Public Member Functions

 LambertianBRDF (void)
virtual RetVal reflectance (const MatVisitor &visitor, const Vector3 *L, const Vector3 *V, const Vector3 *N, Vector3 &color)
virtual RetVal reflectanceVNL (const MatVisitor &visitor, const Vector3 *L, const Vector3 *V, const Vector3 *N, double NV, double NL, Vector3 &color)
virtual RetVal reflectanceNL (const MatVisitor &visitor, const Vector3 *L, const Vector3 *V, const Vector3 *N, double NL, Vector3 &color)
virtual BRDFclone (void) const
virtual double albedo (const MatVisitor &visitor, const Vector3 &N, const Vector3 *V) const
virtual void importanceSample (const MatVisitor &visitor, const Vector3 &D, double r1, double r2, Vector3 &dir, double *pPDFVal)
virtual Vector2 dir2uv (const MatVisitor &visitor, const Vector3 &N, const Vector3 &D) const
 _isIsotropic (isotropic)
bool diffuse (void) const
bool specular (void) const
bool isotropic (void) const
bool anisotropic (void) const

Public Attributes

 __pad0__: _isDiffuse(diffuse)

Protected Member Functions

virtual void _duplicate_attributes (const BRDF &src)

Protected Attributes

bool _isDiffuse
bool _isIsotropic

Detailed Description

BRDF for Lambertians perfect diffuse reflectance.

$ BRDF = k_d $;

Definition at line 19 of file LambertianBRDF.h.


Member Enumeration Documentation

enum RetVal [inherited]
 

Informations about reflectance

Enumerator:
NONZERO_CONTRIB  color is set (including black)
BAD_PARAMS  unable to compute reflectance
NL_NEGATIVE  dot-product of normal, N, and light direction, L, is less than zero
NV_NEGATIVE  dot-product of normal, N, and viewer direction, V, is less than zero
NL_OR_NV_NEGATIVE  either N*L or N*V is less than zero
ZERO_CONTRIB  no energy is reflected in given direction

Definition at line 22 of file BRDF.h.


Constructor & Destructor Documentation

LambertianBRDF void   )  [inline]
 

Constructor

Definition at line 29 of file LambertianBRDF.h.


Member Function Documentation

virtual void _duplicate_attributes const BRDF src  )  [inline, protected, virtual]
 

Reimplemented from DiffuseBRDF.

Definition at line 21 of file LambertianBRDF.h.

References DiffuseBRDF::_duplicate_attributes().

_isIsotropic isotropic   )  [inline, inherited]
 

Definition at line 51 of file BRDF.h.

virtual double albedo const MatVisitor visitor,
const Vector3 N,
const Vector3 V
const [inline, virtual]
 

Albedo for importance sampling strategies.

Parameters:
visitor visitor of material coefficients
N normalized normal vector
V normalized direction to viewer
Returns:
$ albedo = \frac{k_d}{\pi} $

Implements DiffuseBRDF.

Definition at line 106 of file LambertianBRDF.h.

References MatVisitor::avgDiffuse(), and PI.

bool anisotropic void   )  const [inline, inherited]
 

Returns:
true if BRDF is anisotropic (reflectance dependents on rotation around normal), false otherwise

Definition at line 80 of file BRDF.h.

virtual BRDF* clone void   )  const [inline, virtual]
 

Duplicates the BRDF

Implements DiffuseBRDF.

Definition at line 96 of file LambertianBRDF.h.

bool diffuse void   )  const [inline, inherited]
 

Returns:
true if BRDF is diffuse, false otherwise

Definition at line 61 of file BRDF.h.

virtual Vector2 dir2uv const MatVisitor visitor,
const Vector3 N,
const Vector3 D
const [inline, virtual]
 

Gets direction in global coords and returns its generating "random" numbers (i.e. the inverse function to importanceSample()).

Parameters:
visitor not used
N normalized normal vector
D normalized direction
Returns:
"random" numbers generating direction D; x item of returned vector corresponds to r1 of importanceSample() method, y item corresponds to r2; $ (u,v) = (1 - \cos^2{\theta}, \frac{\phi}{2 \pi}) = (\sin^2{\theta}, \frac{\phi}{2 \pi}) $

Implements DiffuseBRDF.

Definition at line 150 of file LambertianBRDF.h.

References Hemisphere::dir2uvUniformly().

virtual void importanceSample const MatVisitor visitor,
const Vector3 D,
double  r1,
double  r2,
Vector3 dir,
double *  pPDFVal
[inline, virtual]
 

Point sampling interface - importance sampling. This method gets two random numbers and preffered direction of random sample and selects amd returns random direction.

$ (\theta, \phi) = (\arccos{(\sqrt{1-r_1})}, 2 \pi r_2) $

Parameters:
visitor visitor of material coefficients
D normalized vector determining prefered direction of the sample
r1 random number from the range [0,1)
r2 random number from the range [0,1)
dir random direction selected by this method ($ (\theta,\phi) $ transformed to the world coodinates)
pPDFVal corresponding PDF value

Implements DiffuseBRDF.

Definition at line 127 of file LambertianBRDF.h.

References Hemisphere::sampleUniformly().

bool isotropic void   )  const [inline, inherited]
 

Returns:
true if BRDF is isotropic (reflectance is independent of rotation around normal), false otherwise

Definition at line 73 of file BRDF.h.

virtual RetVal reflectance const MatVisitor visitor,
const Vector3 L,
const Vector3 V,
const Vector3 N,
Vector3 color
[inline, virtual]
 

Computes and returns actual reflectance.

Parameters:
visitor visitor of material coefficients
L not used
V not used
N not used
color computed reflected energy (color)
Returns:
additionnal informations about reflected energy

Implements DiffuseBRDF.

Definition at line 41 of file LambertianBRDF.h.

References MatVisitor::diffuse().

virtual RetVal reflectanceNL const MatVisitor visitor,
const Vector3 L,
const Vector3 V,
const Vector3 N,
double  NL,
Vector3 color
[inline, virtual]
 

Computes and returns actual reflectance. This variant speeds up the computation using given precomputed dot-product of N and L

Parameters:
visitor visitor of material coefficients
L not used
V not used
N not used
NL precomputed dot-product of normal N and L
color computed reflected energy (color)
Returns:
additionnal informations about reflected energy

Implements DiffuseBRDF.

Definition at line 86 of file LambertianBRDF.h.

References MatVisitor::diffuse().

virtual RetVal reflectanceVNL const MatVisitor visitor,
const Vector3 L,
const Vector3 V,
const Vector3 N,
double  NV,
double  NL,
Vector3 color
[inline, virtual]
 

Computes and returns actual reflectance. This variant speeds up the computation using given precomputed dot-products of N, V and L

Parameters:
visitor visitor of material coefficients
L not used
V not used
N not used
NV precomputed dot-product of normal N and V
NL precomputed dot-product of normal N and L
color computed reflected energy (color)
Returns:
additionnal informations about reflected energy

Implements DiffuseBRDF.

Definition at line 63 of file LambertianBRDF.h.

References MatVisitor::diffuse().

bool specular void   )  const [inline, inherited]
 

Returns:
true if BRDF is specular, false otherwise

Definition at line 66 of file BRDF.h.


Member Data Documentation

__pad0__ [inherited]
 

Contructor

Parameters:
diffuse determines whether this BRDF is diffuse (reflectance is independent of viewer direction)
isotropic determines whether this BRDF is isotropic (reflectance is independent of rotation around normal)

Definition at line 51 of file BRDF.h.

bool _isDiffuse [protected, inherited]
 

Definition at line 32 of file BRDF.h.

Referenced by BRDF::_duplicate_attributes().

bool _isIsotropic [protected, inherited]
 

Definition at line 33 of file BRDF.h.

Referenced by BRDF::_duplicate_attributes().


The documentation for this class was generated from the following file:
Generated on Wed Jun 28 12:24:33 2006 for esg by  doxygen 1.4.6