#include <WallMaterial.h>
Public Member Functions | |
WallMaterial (BSDF b, const float &dens) | |
virtual | ~WallMaterial () |
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 RGBColor | getEmitted (const Vec3D &wOut, Intersection &is) |
virtual ScatterEvent | scatterPhoton (Intersection &is, Photon *photon) |
virtual bool | refracts () const |
virtual bool | hasDiffuse () const |
virtual bool | hasSpecular () const |
virtual bool | hasTransmissive () const |
void | distortNormal (Intersection &is) const |
Vec3D | calcDistNormal (Intersection &is) const |
Vec3D | getShadingNormal (Intersection &is) const |
Private Attributes | |
BSDFMaterial | mat |
float | density |
Definition at line 12 of file WallMaterial.h.
rcrt::WallMaterial::WallMaterial | ( | BSDF | b, | |
const float & | dens | |||
) |
Definition at line 6 of file WallMaterial.cpp.
rcrt::WallMaterial::~WallMaterial | ( | ) | [virtual] |
Definition at line 10 of file WallMaterial.cpp.
RGBColor rcrt::WallMaterial::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 14 of file WallMaterial.cpp.
References density, distortNormal(), rcrt::Intersection::getPosition(), mat, PerlinNoise::noise(), and rcrt::BSDFMaterial::sampleDiffuse().
RGBColor rcrt::WallMaterial::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 24 of file WallMaterial.cpp.
References distortNormal(), mat, and rcrt::BSDFMaterial::sampleDiffuse().
RGBColor rcrt::WallMaterial::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 33 of file WallMaterial.cpp.
References distortNormal(), mat, and rcrt::BSDFMaterial::sampleSpecular().
RGBColor rcrt::WallMaterial::getEmitted | ( | const Vec3D & | wOut, | |
Intersection & | is | |||
) | [virtual] |
wOut | the outgoing direction. | |
is | The Intersection data. |
Implements rcrt::Material.
Definition at line 41 of file WallMaterial.cpp.
ScatterEvent rcrt::WallMaterial::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 46 of file WallMaterial.cpp.
References mat, and rcrt::BSDFMaterial::scatterPhoton().
bool rcrt::WallMaterial::refracts | ( | ) | const [virtual] |
bool rcrt::WallMaterial::hasDiffuse | ( | ) | const [virtual] |
Implements rcrt::Material.
Definition at line 56 of file WallMaterial.cpp.
References rcrt::BSDFMaterial::hasDiffuse(), and mat.
bool rcrt::WallMaterial::hasSpecular | ( | ) | const [virtual] |
Implements rcrt::Material.
Definition at line 61 of file WallMaterial.cpp.
References rcrt::BSDFMaterial::hasSpecular(), and mat.
bool rcrt::WallMaterial::hasTransmissive | ( | ) | const [virtual] |
Implements rcrt::Material.
Definition at line 65 of file WallMaterial.cpp.
References rcrt::BSDFMaterial::hasTransmissive(), and mat.
void rcrt::WallMaterial::distortNormal | ( | Intersection & | is | ) | const |
Definition at line 70 of file WallMaterial.cpp.
References calcDistNormal(), and rcrt::Intersection::setSNormalW().
Referenced by sample(), sampleDiffuse(), and sampleSpecular().
Vec3D rcrt::WallMaterial::calcDistNormal | ( | Intersection & | is | ) | const |
Definition at line 75 of file WallMaterial.cpp.
References density, rcrt::Intersection::getPosition(), rcrt::Intersection::getSNormalW(), PerlinNoise::noise(), rcrt::Vec3D::x(), rcrt::Point3D::x(), rcrt::Point3D::y(), rcrt::Vec3D::z(), and rcrt::Point3D::z().
Referenced by distortNormal().
Vec3D rcrt::WallMaterial::getShadingNormal | ( | Intersection & | is | ) | const [virtual] |
Reimplemented from rcrt::Material.
Definition at line 91 of file WallMaterial.cpp.
References rcrt::Intersection::getSNormalW().
BSDFMaterial rcrt::WallMaterial::mat [private] |
Definition at line 15 of file WallMaterial.h.
Referenced by hasDiffuse(), hasSpecular(), hasTransmissive(), sample(), sampleDiffuse(), sampleSpecular(), and scatterPhoton().
float rcrt::WallMaterial::density [private] |