#include <Material.h>
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 RGBColor & | getAbsorbance () 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 |
Texture2D * | bumpMap |
float | bumpFactor |
int | frame |
Definition at line 20 of file Material.h.
rcrt::Material::Material | ( | float | iorR = 1 , |
|
float | iorI = 0 , |
|||
const RGBColor & | absorb = RGBColor::BLACK | |||
) |
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.
virtual RGBColor rcrt::Material::sample | ( | const Vec3D & | wOut, | |
const Vec3D & | wInc, | |||
Intersection & | is | |||
) | [pure virtual] |
wOut | The outgoing direction. | |
wInc | The incoming direction. | |
is | The Intersection data. |
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] |
wOut | The outgoing direction. | |
wInc | The incoming direction. | |
is | The Intersection data. |
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] |
wOut | The outgoing direction. Should be the reflected direction of wInc (and vice versa) | |
wInc | The incoming direction. | |
is | The Intersection data. |
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] |
wOut | the outgoing direction. | |
is | The Intersection data. |
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.
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 |
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] |
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] |
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 | ) |
void rcrt::Material::setBumpFactor | ( | const float & | f | ) |
void rcrt::Material::setFrame | ( | const int & | n | ) |
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] |
Texture2D* rcrt::Material::bumpMap [protected] |
float rcrt::Material::bumpFactor [protected] |
int rcrt::Material::frame [protected] |