BRDF Class Reference

#include <BRDF.h>

Inheritance diagram for BRDF:

ESGObject DiffuseBRDF SpecularBRDF LambertianBRDF BlinnBRDF CookTorranceBRDF PhongBRDF 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

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

Public Attributes

 __pad0__: _isDiffuse(diffuse)

Protected Member Functions

virtual void _duplicate_attributes (const BRDF &src)

Protected Attributes

bool _isDiffuse
bool _isIsotropic

Detailed Description

Bidirectional Reflectance Distribution Functions

Definition at line 17 of file BRDF.h.


Member Enumeration Documentation

enum RetVal
 

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

virtual ~BRDF  )  [inline, virtual]
 

Destructor

Definition at line 56 of file BRDF.h.


Member Function Documentation

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

Reimplemented in BlinnBRDF, CookTorranceBRDF, DiffuseBRDF, LambertianBRDF, PhongBRDF, and SpecularBRDF.

Definition at line 36 of file BRDF.h.

References BRDF::_isDiffuse, and BRDF::_isIsotropic.

Referenced by SpecularBRDF::_duplicate_attributes(), and DiffuseBRDF::_duplicate_attributes().

_isIsotropic isotropic   )  [inline]
 

Definition at line 51 of file BRDF.h.

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

Albedo for importance sampling strategies.

Parameters:
visitor visitor of material coefficients
N normalized normal vector
V normalized direction to viewer
Returns:
albedo

Implemented in BlinnBRDF, CookTorranceBRDF, DiffuseBRDF, LambertianBRDF, PhongBRDF, and SpecularBRDF.

bool anisotropic void   )  const [inline]
 

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  )  const [pure virtual]
 

Duplicates the BRDF

Implemented in BlinnBRDF, CookTorranceBRDF, DiffuseBRDF, LambertianBRDF, PhongBRDF, and SpecularBRDF.

bool diffuse void   )  const [inline]
 

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 [pure virtual]
 

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

Parameters:
visitor visitor of material coefficients
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

Implemented in BlinnBRDF, CookTorranceBRDF, DiffuseBRDF, LambertianBRDF, PhongBRDF, and SpecularBRDF.

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

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

Energy contribution gained from such random directions should be laer devided by average spectral reflectance (e.g. visitor.avgDiffuse() or visitor.avgSpecular()) in order to account for the fact that the reflectance should have used different values for individual spectrums (e.g. RGB)

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
pPDFVal corresponding PDF value

Implemented in BlinnBRDF, CookTorranceBRDF, DiffuseBRDF, LambertianBRDF, PhongBRDF, and SpecularBRDF.

bool isotropic void   )  const [inline]
 

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
[pure virtual]
 

Computes and returns actual reflectance.

Parameters:
visitor visitor of material coefficients
L normalized direction to light source
V normalized direction to viewer
N normalized normal vector
color computed reflected energy (color)
Returns:
additionnal informations about reflected energy

Implemented in BlinnBRDF, CookTorranceBRDF, DiffuseBRDF, LambertianBRDF, PhongBRDF, and SpecularBRDF.

virtual RetVal reflectanceNL const MatVisitor visitor,
const Vector3 L,
const Vector3 V,
const Vector3 N,
double  NL,
Vector3 color
[pure 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 normalized direction to light source
V normalized direction to viewer
N normalized normal vector
NL precomputed dot-product of normal N and L
color computed reflected energy (color)
Returns:
additionnal informations about reflected energy

Implemented in BlinnBRDF, CookTorranceBRDF, DiffuseBRDF, LambertianBRDF, PhongBRDF, and SpecularBRDF.

virtual RetVal reflectanceVNL const MatVisitor visitor,
const Vector3 L,
const Vector3 V,
const Vector3 N,
double  NV,
double  NL,
Vector3 color
[pure 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 normalized direction to light source
V normalized direction to viewer
N normalized normal vector
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

Implemented in BlinnBRDF, CookTorranceBRDF, DiffuseBRDF, LambertianBRDF, PhongBRDF, and SpecularBRDF.

bool specular void   )  const [inline]
 

Returns:
true if BRDF is specular, false otherwise

Definition at line 66 of file BRDF.h.


Member Data Documentation

__pad0__
 

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]
 

Definition at line 32 of file BRDF.h.

Referenced by BRDF::_duplicate_attributes().

bool _isIsotropic [protected]
 

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