rcrt::BSDFMaterial Class Reference

#include <BSDFMaterial.h>

Inheritance diagram for rcrt::BSDFMaterial:

Inheritance graph
[legend]
Collaboration diagram for rcrt::BSDFMaterial:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 BSDFMaterial (BSDF b, const std::complex< float > &ior=std::complex< float >(1, 0))
virtual ~BSDFMaterial ()
virtual bool hasDiffuse () const
virtual bool hasSpecular () const
virtual bool hasTransmissive () const
virtual RGBColor getEmitted (const Vec3D &wOut, Intersection &is)
virtual RGBColor sample (const Vec3D &wOut, const Vec3D &wInc, Intersection &is)
virtual RGBColor sampleDiffuse (const Vec3D &wOut, const Vec3D &wInc, Intersection &is)
virtual RGBColor sampleSpecular (const Vec3D &wOut, const Vec3D &wInc, Intersection &is)
virtual ScatterEvent scatterPhoton (Intersection &is, Photon *photon)
virtual bool refracts () const

Private Attributes

BSDF bsdf


Detailed Description

Definition at line 10 of file BSDFMaterial.h.


Constructor & Destructor Documentation

rcrt::BSDFMaterial::BSDFMaterial ( BSDF  b,
const std::complex< float > &  ior = std::complex<float>(1,0) 
)

Definition at line 9 of file BSDFMaterial.cpp.

rcrt::BSDFMaterial::~BSDFMaterial (  )  [virtual]

Definition at line 13 of file BSDFMaterial.cpp.


Member Function Documentation

bool rcrt::BSDFMaterial::hasDiffuse (  )  const [virtual]

Implements rcrt::Material.

Definition at line 24 of file BSDFMaterial.cpp.

References bsdf, and rcrt::BSDF::hasDiffuse().

Referenced by rcrt::WallMaterial::hasDiffuse().

bool rcrt::BSDFMaterial::hasSpecular (  )  const [virtual]

Implements rcrt::Material.

Definition at line 29 of file BSDFMaterial.cpp.

References bsdf, and rcrt::BSDF::hasSpecular().

Referenced by rcrt::WallMaterial::hasSpecular().

bool rcrt::BSDFMaterial::hasTransmissive (  )  const [virtual]

Implements rcrt::Material.

Definition at line 34 of file BSDFMaterial.cpp.

References bsdf, and rcrt::BSDF::hasTransmissive().

Referenced by rcrt::WallMaterial::hasTransmissive(), and refracts().

RGBColor rcrt::BSDFMaterial::getEmitted ( const Vec3D wOut,
Intersection is 
) [virtual]

Parameters:
wOut the outgoing direction.
is The Intersection data.
Returns:
The amount of emitted light.

Implements rcrt::Material.

Definition at line 39 of file BSDFMaterial.cpp.

RGBColor rcrt::BSDFMaterial::sample ( const Vec3D wOut,
const Vec3D wInc,
Intersection is 
) [virtual]

Parameters:
wOut The outgoing direction.
wInc The incoming direction.
is The Intersection data.
Returns:
The percentage of each colorband reflected/transmitted along this direction.

Implements rcrt::Material.

Definition at line 17 of file BSDFMaterial.cpp.

References bsdf, rcrt::BSDF::eval(), rcrt::Intersection::getGNormalW(), and rcrt::Material::getShadingNormal().

RGBColor rcrt::BSDFMaterial::sampleDiffuse ( const Vec3D wOut,
const Vec3D wInc,
Intersection is 
) [virtual]

Parameters:
wOut The outgoing direction.
wInc The incoming direction.
is The Intersection data.
Returns:
The percentage of each colorband diffusely reflected/transmitted along this direction.

Implements rcrt::Material.

Definition at line 44 of file BSDFMaterial.cpp.

References bsdf, rcrt::BSDF::evalDiffuse(), rcrt::Intersection::getGNormalW(), and rcrt::Material::getShadingNormal().

Referenced by rcrt::WallMaterial::sample(), and rcrt::WallMaterial::sampleDiffuse().

RGBColor rcrt::BSDFMaterial::sampleSpecular ( const Vec3D wOut,
const Vec3D wInc,
Intersection is 
) [virtual]

Parameters:
wOut The outgoing direction. Should be the reflected direction of wInc (and vice versa)
wInc The incoming direction.
is The Intersection data.
Returns:
The percentage of each colorband specularily reflected/transmitted along this direction.

Implements rcrt::Material.

Definition at line 49 of file BSDFMaterial.cpp.

References bsdf, rcrt::BSDF::evalSpecular(), rcrt::Intersection::getGNormalW(), and rcrt::Material::getShadingNormal().

Referenced by rcrt::WallMaterial::sampleSpecular().

ScatterEvent rcrt::BSDFMaterial::scatterPhoton ( Intersection is,
Photon photon 
) [virtual]

Scatters a Photon.

Parameters:
is The Intersection data. Currently this also includes a previous IOR. //TODO refactor the ior stuff
photon A photon, this should be set to the intersection point, a new outgoing direction and should be scaled in power according to the sampling process.

Implements rcrt::Material.

Definition at line 54 of file BSDFMaterial.cpp.

References rcrt::Intersection::backSide(), bsdf, rcrt::DIFFUSE, rcrt::Vec3D::getCS(), rcrt::Photon::getDir(), rcrt::BSDF::getKdiffuse(), rcrt::BSDF::getKspecular(), rcrt::BSDF::getKtransmit(), rcrt::Intersection::getLastIOR(), rcrt::Intersection::getPosition(), rcrt::Photon::getPower(), rcrt::Material::getShadingNormal(), rcrt::Material::ior, rcrt::Vec3D::normalize(), rcrt::RGBColor::r(), rcrt::Vec3D::reflect(), rcrt::REFRACTED, rcrt::Photon::scalePower(), rcrt::Photon::setDir(), rcrt::Photon::setPos(), rcrt::snell(), rcrt::SPECULAR, and rcrt::STORE.

Referenced by rcrt::WallMaterial::scatterPhoton().

bool rcrt::BSDFMaterial::refracts (  )  const [virtual]

Reimplemented from rcrt::Material.

Definition at line 122 of file BSDFMaterial.cpp.

References hasTransmissive().


Member Data Documentation

BSDF rcrt::BSDFMaterial::bsdf [private]

Definition at line 13 of file BSDFMaterial.h.

Referenced by hasDiffuse(), hasSpecular(), hasTransmissive(), sample(), sampleDiffuse(), sampleSpecular(), and scatterPhoton().


The documentation for this class was generated from the following files:
Generated on Thu Jan 31 19:32:47 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3