CookTorranceBRDF Class Reference

#include <CookTorranceBRDF.h>

Inheritance diagram for CookTorranceBRDF:

SpecularBRDF 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

 CookTorranceBRDF (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

Physically based specular reflection of Cook and Torrance based on the work of Blinn.

Reference: Watt A.: 3D Computer Graphics, p. 213-221, Addison-Wesley, Edinburg,2000.

Definition at line 19 of file CookTorranceBRDF.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

CookTorranceBRDF void   )  [inline]
 

Constructor

Definition at line 29 of file CookTorranceBRDF.h.


Member Function Documentation

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

Reimplemented from SpecularBRDF.

Definition at line 21 of file CookTorranceBRDF.h.

References SpecularBRDF::_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

Implements SpecularBRDF.

Definition at line 54 of file CookTorranceBRDF.h.

References PhongBRDF::albedo().

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 SpecularBRDF.

Definition at line 52 of file CookTorranceBRDF.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 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

Implements SpecularBRDF.

Definition at line 72 of file CookTorranceBRDF.h.

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.

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

Implements SpecularBRDF.

Definition at line 61 of file CookTorranceBRDF.h.

References PhongBRDF::importanceSample().

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.

BRDF::RetVal reflectance const MatVisitor visitor,
const Vector3 L,
const Vector3 V,
const Vector3 N,
Vector3 color
[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

Implements SpecularBRDF.

Definition at line 5 of file CookTorranceBRDF.cc.

References BRDF::BAD_PARAMS, MatVisitor::diffuse(), MatVisitor::fresnelTerm(), MatVisitor::gaussianCoef(), BRDF::NL_NEGATIVE, BRDF::NONZERO_CONTRIB, BRDF::NV_NEGATIVE, and MatVisitor::roughness().

BRDF::RetVal reflectanceNL const MatVisitor visitor,
const Vector3 L,
const Vector3 V,
const Vector3 N,
double  NL,
Vector3 color
[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

Implements SpecularBRDF.

Definition at line 204 of file CookTorranceBRDF.cc.

References BRDF::BAD_PARAMS, MatVisitor::diffuse(), MatVisitor::fresnelTerm(), MatVisitor::gaussianCoef(), BRDF::NONZERO_CONTRIB, BRDF::NV_NEGATIVE, MatVisitor::roughness(), and MatVisitor::specular().

BRDF::RetVal reflectanceVNL const MatVisitor visitor,
const Vector3 L,
const Vector3 V,
const Vector3 N,
double  NV,
double  NL,
Vector3 color
[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

Implements SpecularBRDF.

Definition at line 107 of file CookTorranceBRDF.cc.

References BRDF::BAD_PARAMS, MatVisitor::diffuse(), MatVisitor::fresnelTerm(), MatVisitor::gaussianCoef(), BRDF::NONZERO_CONTRIB, MatVisitor::roughness(), and MatVisitor::specular().

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 files:
Generated on Wed Jun 28 12:24:33 2006 for esg by  doxygen 1.4.6