#include <BSDFMaterial.h>
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 |
Definition at line 10 of file BSDFMaterial.h.
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.
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] |
wOut | the outgoing direction. | |
is | The Intersection data. |
Implements rcrt::Material.
Definition at line 39 of file BSDFMaterial.cpp.
RGBColor rcrt::BSDFMaterial::sample | ( | const Vec3D & | wOut, | |
const Vec3D & | wInc, | |||
Intersection & | is | |||
) | [virtual] |
wOut | The outgoing direction. | |
wInc | The incoming direction. | |
is | The Intersection data. |
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] |
wOut | The outgoing direction. | |
wInc | The incoming direction. | |
is | The Intersection data. |
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] |
wOut | The outgoing direction. Should be the reflected direction of wInc (and vice versa) | |
wInc | The incoming direction. | |
is | The Intersection data. |
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.
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().
BSDF rcrt::BSDFMaterial::bsdf [private] |
Definition at line 13 of file BSDFMaterial.h.
Referenced by hasDiffuse(), hasSpecular(), hasTransmissive(), sample(), sampleDiffuse(), sampleSpecular(), and scatterPhoton().