rcrt::Material Class Reference

#include <Material.h>

Inheritance diagram for rcrt::Material:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Material (float iorR=1, float iorI=0, const RGBColor &absorb=RGBColor::BLACK)
 Material (const std::complex< float > &IOR, const RGBColor &absorb=RGBColor::BLACK)
virtual ~Material ()
virtual RGBColor sample (const Vec3D &wOut, const Vec3D &wInc, Intersection &is)=0
virtual RGBColor sampleDiffuse (const Vec3D &wOut, const Vec3D &wInc, Intersection &is)=0
virtual RGBColor sampleSpecular (const Vec3D &wOut, const Vec3D &wInc, Intersection &is)=0
virtual RGBColor getEmitted (const Vec3D &wOut, Intersection &is)=0
virtual ScatterEvent scatterPhoton (Intersection &is, Photon *photon)=0
const float & getRealIORPart () const
const float & getImagIORPart () const
const std::complex
< float > 
getIOR () const
virtual bool refracts () const
virtual bool hasDiffuse () const =0
virtual bool hasSpecular () const =0
virtual bool hasTransmissive () const =0
virtual const RGBColorgetAbsorbance () const
virtual Vec3D getShadingNormal (Intersection &is) const
void setBumpMap (Texture2D *tex)
void setBumpFactor (const float &f)
void setFrame (const int &n)

Protected Attributes

std::complex< float > ior
RGBColor absorbance
Texture2DbumpMap
float bumpFactor
int frame


Detailed Description

A base class for materials.

Definition at line 20 of file Material.h.


Constructor & Destructor Documentation

rcrt::Material::Material ( float  iorR = 1,
float  iorI = 0,
const RGBColor absorb = RGBColor::BLACK 
)

Parameters:
iorR the real ior part
iorI the imaginary ior part
absorb the absorbance, a value of (0,0,0) means no absorbance, (1,1,1) would absorb everything

Definition at line 8 of file Material.cpp.

rcrt::Material::Material ( const std::complex< float > &  IOR,
const RGBColor absorb = RGBColor::BLACK 
)

Definition at line 12 of file Material.cpp.

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

Definition at line 16 of file Material.cpp.


Member Function Documentation

virtual RGBColor rcrt::Material::sample ( const Vec3D wOut,
const Vec3D wInc,
Intersection is 
) [pure 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.

Implemented in rcrt::BlackMaterial, rcrt::BSDFMaterial, rcrt::DebugMaterial, rcrt::DielectricMaterial, rcrt::ImageMaterial, rcrt::LightMaterial, rcrt::MirrorMaterial, rcrt::WallMaterial, and rcrt::WoodMaterial.

Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonTracer::directLight(), rcrt::PhotonMap::getRadiance(), rcrt::RayCaster::trace(), and rcrt::PhotonTracer::trace().

virtual RGBColor rcrt::Material::sampleDiffuse ( const Vec3D wOut,
const Vec3D wInc,
Intersection is 
) [pure 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.

Implemented in rcrt::BlackMaterial, rcrt::BSDFMaterial, rcrt::DebugMaterial, rcrt::DielectricMaterial, rcrt::ImageMaterial, rcrt::LightMaterial, rcrt::MirrorMaterial, rcrt::WallMaterial, and rcrt::WoodMaterial.

virtual RGBColor rcrt::Material::sampleSpecular ( const Vec3D wOut,
const Vec3D wInc,
Intersection is 
) [pure 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.

Implemented in rcrt::BlackMaterial, rcrt::BSDFMaterial, rcrt::DebugMaterial, rcrt::DielectricMaterial, rcrt::ImageMaterial, rcrt::LightMaterial, rcrt::MirrorMaterial, rcrt::WallMaterial, and rcrt::WoodMaterial.

Referenced by rcrt::SimpleTracer::trace(), and rcrt::PhotonTracer::trace().

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

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

Implemented in rcrt::BlackMaterial, rcrt::BSDFMaterial, rcrt::DebugMaterial, rcrt::DielectricMaterial, rcrt::ImageMaterial, rcrt::LightMaterial, rcrt::MirrorMaterial, rcrt::WallMaterial, and rcrt::WoodMaterial.

Referenced by rcrt::SimpleTracer::trace(), and rcrt::PhotonTracer::trace().

virtual ScatterEvent rcrt::Material::scatterPhoton ( Intersection is,
Photon photon 
) [pure 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.

Implemented in rcrt::BlackMaterial, rcrt::BSDFMaterial, rcrt::DebugMaterial, rcrt::DielectricMaterial, rcrt::ImageMaterial, rcrt::LightMaterial, rcrt::MirrorMaterial, rcrt::WallMaterial, and rcrt::WoodMaterial.

Referenced by rcrt::PhotonMap::generateJob().

const float & rcrt::Material::getRealIORPart (  )  const

Definition at line 33 of file Material.cpp.

References ior.

Referenced by rcrt::SimpleTracer::trace(), and rcrt::PhotonTracer::trace().

const float & rcrt::Material::getImagIORPart (  )  const

Definition at line 38 of file Material.cpp.

References ior.

const std::complex< float > rcrt::Material::getIOR (  )  const

Definition at line 48 of file Material.cpp.

References ior.

Referenced by rcrt::PhotonMap::generateJob().

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

Reimplemented in rcrt::BlackMaterial, rcrt::BSDFMaterial, rcrt::DebugMaterial, rcrt::DielectricMaterial, rcrt::LightMaterial, rcrt::MirrorMaterial, rcrt::WallMaterial, and rcrt::WoodMaterial.

Definition at line 43 of file Material.cpp.

References ior.

Referenced by rcrt::Scene::isOccluded(), rcrt::SimpleTracer::trace(), and rcrt::PhotonTracer::trace().

virtual bool rcrt::Material::hasDiffuse (  )  const [pure virtual]

Implemented in rcrt::BlackMaterial, rcrt::BSDFMaterial, rcrt::DebugMaterial, rcrt::DielectricMaterial, rcrt::ImageMaterial, rcrt::LightMaterial, rcrt::MirrorMaterial, rcrt::WallMaterial, and rcrt::WoodMaterial.

virtual bool rcrt::Material::hasSpecular (  )  const [pure virtual]

Implemented in rcrt::BlackMaterial, rcrt::BSDFMaterial, rcrt::DebugMaterial, rcrt::DielectricMaterial, rcrt::ImageMaterial, rcrt::LightMaterial, rcrt::MirrorMaterial, rcrt::WallMaterial, and rcrt::WoodMaterial.

Referenced by rcrt::PhotonTracer::trace().

virtual bool rcrt::Material::hasTransmissive (  )  const [pure virtual]

Implemented in rcrt::BlackMaterial, rcrt::BSDFMaterial, rcrt::DebugMaterial, rcrt::DielectricMaterial, rcrt::ImageMaterial, rcrt::LightMaterial, rcrt::MirrorMaterial, rcrt::WallMaterial, and rcrt::WoodMaterial.

const RGBColor & rcrt::Material::getAbsorbance (  )  const [virtual]

Definition at line 81 of file Material.cpp.

References absorbance.

Referenced by rcrt::SimpleTracer::trace(), and rcrt::PhotonTracer::trace().

Vec3D rcrt::Material::getShadingNormal ( Intersection is  )  const [virtual]

Reimplemented in rcrt::WallMaterial, and rcrt::WoodMaterial.

Definition at line 53 of file Material.cpp.

References rcrt::Intersection::backSide(), bumpFactor, bumpMap, rcrt::Texture2D::getBump(), rcrt::Matrix4D::getOrthoNormalBasis(), rcrt::Intersection::getPrimitive(), rcrt::Intersection::getSNormalW(), rcrt::Primitive::getTangent(), and rcrt::Intersection::getUV().

Referenced by rcrt::SimpleTracer::directLight(), rcrt::PhotonMap::getRadiance(), rcrt::DebugMaterial::sample(), rcrt::BSDFMaterial::sample(), rcrt::BSDFMaterial::sampleDiffuse(), rcrt::BSDFMaterial::sampleSpecular(), rcrt::ImageMaterial::scatterPhoton(), rcrt::DielectricMaterial::scatterPhoton(), rcrt::BSDFMaterial::scatterPhoton(), rcrt::SimpleTracer::trace(), and rcrt::PhotonTracer::trace().

void rcrt::Material::setBumpMap ( Texture2D tex  ) 

Definition at line 71 of file Material.cpp.

References bumpMap.

Referenced by testDispl1().

void rcrt::Material::setBumpFactor ( const float &  f  ) 

Definition at line 76 of file Material.cpp.

References bumpFactor.

Referenced by testDispl1().

void rcrt::Material::setFrame ( const int &  n  ) 

Definition at line 86 of file Material.cpp.

References frame.


Member Data Documentation

std::complex<float> rcrt::Material::ior [protected]

Definition at line 23 of file Material.h.

Referenced by getImagIORPart(), getIOR(), getRealIORPart(), refracts(), rcrt::DielectricMaterial::scatterPhoton(), and rcrt::BSDFMaterial::scatterPhoton().

RGBColor rcrt::Material::absorbance [protected]

Definition at line 24 of file Material.h.

Referenced by getAbsorbance().

Texture2D* rcrt::Material::bumpMap [protected]

Definition at line 25 of file Material.h.

Referenced by getShadingNormal(), and setBumpMap().

float rcrt::Material::bumpFactor [protected]

Definition at line 26 of file Material.h.

Referenced by getShadingNormal(), and setBumpFactor().

int rcrt::Material::frame [protected]

Definition at line 27 of file Material.h.

Referenced by setFrame().


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