Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

toxic::BSDF Class Reference

Bidirectional Scattering Distribution Function (BSDF). More...

#include <bsdf.h>

Inheritance diagram for toxic::BSDF:

toxic::IBDF sheep::IClonable< IBDF > List of all members.

Public Member Functions

 BSDF ()
virtual ~BSDF ()
virtual bool IsDiffuse () const
virtual bool IsSpecular () const
void Insert (const IBRDF *brdf, sheep::Real weight)
void Insert (const IBTDF *btdf, sheep::Real weight)
virtual sheep::Real Evaluate (const Context &context, const sheep::Vector3 &incoming, const sheep::Vector3 &outgoing) const
virtual sheep::Real EvaluateSpecular (const Context &context, const sheep::Vector3 &incoming, sheep::Vector3 *outgoing) const
virtual void Sample (const Context &context, const sheep::Vector3 &incoming, sheep::Vector3 *outgoing, sheep::Real *prob, sheep::Real *value) const
virtual sheep::Real ComputeScatteringProbability (const sheep::Vector3 &incoming, const sheep::Vector3 &outgoing) const
virtual sheep::Real ComputeReflectance (const Context &context) const
 Computes and returns the hemispherical hemispherical reflectance.

virtual sheep::Real ComputeReflectance (const Context &context, const sheep::Vector3 &incoming) const

Private Types

typedef std::pair< const IBRDF *,
sheep::Real
weighted_brdf
typedef std::pair< const IBTDF *,
sheep::Real
weighted_btdf
typedef std::vector< weighted_brdfbrdf_vector
typedef std::vector< weighted_btdfbtdf_vector
typedef brdf_vector::const_iterator brdf_vector_const_it
typedef btdf_vector::const_iterator btdf_vector_const_it

Private Attributes

brdf_vector m_brdfs
 Vector of all BRDFs.

btdf_vector m_btdfs
 Vector of all BTDFs.

brdf_vector m_specular_brdfs
 Vector of specular BRDFs.

btdf_vector m_specular_btdfs
 Vector of specular BTDFs.

sheep::Real m_total_weight
 The total weight of all components (BRDFs and BTDFs).


Detailed Description

Bidirectional Scattering Distribution Function (BSDF).

Definition at line 39 of file bsdf.h.


Member Typedef Documentation

typedef std::vector<weighted_brdf> toxic::BSDF::brdf_vector [private]
 

Definition at line 94 of file bsdf.h.

typedef brdf_vector::const_iterator toxic::BSDF::brdf_vector_const_it [private]
 

Definition at line 97 of file bsdf.h.

Referenced by ComputeReflectance(), ComputeScatteringProbability(), Evaluate(), and Sample().

typedef std::vector<weighted_btdf> toxic::BSDF::btdf_vector [private]
 

Definition at line 95 of file bsdf.h.

typedef btdf_vector::const_iterator toxic::BSDF::btdf_vector_const_it [private]
 

Definition at line 98 of file bsdf.h.

Referenced by ComputeReflectance(), ComputeScatteringProbability(), Evaluate(), and Sample().

typedef std::pair<const IBRDF *, sheep::Real> toxic::BSDF::weighted_brdf [private]
 

Definition at line 91 of file bsdf.h.

typedef std::pair<const IBTDF *, sheep::Real> toxic::BSDF::weighted_btdf [private]
 

Definition at line 92 of file bsdf.h.


Constructor & Destructor Documentation

BSDF::BSDF  ) 
 

Definition at line 32 of file bsdf.cpp.

virtual toxic::BSDF::~BSDF  )  [inline, virtual]
 

Definition at line 43 of file bsdf.h.


Member Function Documentation

Real BSDF::ComputeReflectance const Context context,
const sheep::Vector3 incoming
const [virtual]
 

Computes and returns the directional hemispherical reflectance. The incoming direction is expressed in local space.

Reimplemented from toxic::IBDF.

Definition at line 188 of file bsdf.cpp.

References brdf_vector_const_it, btdf_vector_const_it, sheep::Vector3::IsUnitLength(), m_brdfs, m_btdfs, and sheep::Vector3::m_y.

Real BSDF::ComputeReflectance const Context context  )  const [virtual]
 

Computes and returns the hemispherical hemispherical reflectance.

Reimplemented from toxic::IBDF.

Definition at line 176 of file bsdf.cpp.

References brdf_vector_const_it, btdf_vector_const_it, m_brdfs, and m_btdfs.

Real BSDF::ComputeScatteringProbability const sheep::Vector3 incoming,
const sheep::Vector3 outgoing
const [virtual]
 

Computes the probability of scattering from 'incoming' direction to 'outgoing' direction. Both incoming and outgoing directions are expressed in local space.

Todo:
Precompute the division.

Reimplemented from toxic::IBDF.

Definition at line 155 of file bsdf.cpp.

References brdf_vector_const_it, btdf_vector_const_it, m_brdfs, and m_btdfs.

Real BSDF::Evaluate const Context context,
const sheep::Vector3 incoming,
const sheep::Vector3 outgoing
const [virtual]
 

Evaluates the function. Both the incoming and outgoing directions are expressed in local space.

Implements toxic::IBDF.

Definition at line 63 of file bsdf.cpp.

References brdf_vector_const_it, btdf_vector_const_it, sheep::Vector3::IsUnitLength(), m_brdfs, m_btdfs, and sheep::Vector3::m_y.

Real BSDF::EvaluateSpecular const Context context,
const sheep::Vector3 incoming,
sheep::Vector3 outgoing
const [virtual]
 

Reimplemented from toxic::IBDF.

Definition at line 89 of file bsdf.cpp.

References toxic::IBDF::EvaluateSpecular(), sheep::Vector3::IsUnitLength(), toxic::Context::m_rng, m_specular_brdfs, m_specular_btdfs, sheep::Vector3::m_y, and sheep::MT19937RNG::RandomInt().

void BSDF::Insert const IBTDF btdf,
sheep::Real  weight
 

Definition at line 50 of file bsdf.cpp.

References toxic::IBDF::IsSpecular(), m_btdfs, m_specular_btdfs, and m_total_weight.

void BSDF::Insert const IBRDF brdf,
sheep::Real  weight
 

Definition at line 37 of file bsdf.cpp.

References toxic::IBDF::IsSpecular(), m_brdfs, m_specular_brdfs, and m_total_weight.

bool BSDF::IsDiffuse  )  const [inline, virtual]
 

Reimplemented from toxic::IBDF.

Definition at line 131 of file bsdf.h.

bool BSDF::IsSpecular  )  const [inline, virtual]
 

Reimplemented from toxic::IBDF.

Definition at line 138 of file bsdf.h.

void BSDF::Sample const Context context,
const sheep::Vector3 incoming,
sheep::Vector3 outgoing,
sheep::Real prob,
sheep::Real value
const [virtual]
 

Samples the function in order to obtain an outgoing direction, given an incoming direction. The probability with which the direction has been chosen is also computed. Both incoming and outgoing directions are expressed in local space.

Todo:
Sample according to the albedo or the weight of the component.

Precompute the division.

Reimplemented from toxic::IBDF.

Definition at line 114 of file bsdf.cpp.

References brdf_vector_const_it, btdf_vector_const_it, sheep::Vector3::IsUnitLength(), m_brdfs, m_btdfs, toxic::Context::m_rng, sheep::Vector3::m_y, sheep::MT19937RNG::RandomInt(), and toxic::IBDF::Sample().


Member Data Documentation

brdf_vector toxic::BSDF::m_brdfs [private]
 

Vector of all BRDFs.

Definition at line 100 of file bsdf.h.

Referenced by ComputeReflectance(), ComputeScatteringProbability(), Evaluate(), Insert(), and Sample().

btdf_vector toxic::BSDF::m_btdfs [private]
 

Vector of all BTDFs.

Definition at line 101 of file bsdf.h.

Referenced by ComputeReflectance(), ComputeScatteringProbability(), Evaluate(), Insert(), and Sample().

brdf_vector toxic::BSDF::m_specular_brdfs [private]
 

Vector of specular BRDFs.

Definition at line 102 of file bsdf.h.

Referenced by EvaluateSpecular(), and Insert().

btdf_vector toxic::BSDF::m_specular_btdfs [private]
 

Vector of specular BTDFs.

Definition at line 103 of file bsdf.h.

Referenced by EvaluateSpecular(), and Insert().

sheep::Real toxic::BSDF::m_total_weight [private]
 

The total weight of all components (BRDFs and BTDFs).

Definition at line 105 of file bsdf.h.

Referenced by Insert().


The documentation for this class was generated from the following files:
Generated on Tue May 11 01:31:57 2004 for toxic by doxygen 1.3.6