#include <ImageMaterial.h>
Public Member Functions | |
ImageMaterial (ImageTexture *i, float iorR=1, float iorI=0) | |
ImageMaterial (ImageTexture *i, const std::complex< float > &IOR) | |
virtual | ~ImageMaterial () |
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 | hasDiffuse () const |
virtual bool | hasSpecular () const |
virtual bool | hasTransmissive () const |
Private Attributes | |
ImageTexture * | imageTex |
Definition at line 9 of file ImageMaterial.h.
rcrt::ImageMaterial::ImageMaterial | ( | ImageTexture * | i, | |
float | iorR = 1 , |
|||
float | iorI = 0 | |||
) |
Definition at line 6 of file ImageMaterial.cpp.
rcrt::ImageMaterial::ImageMaterial | ( | ImageTexture * | i, | |
const std::complex< float > & | IOR | |||
) |
Definition at line 10 of file ImageMaterial.cpp.
rcrt::ImageMaterial::~ImageMaterial | ( | ) | [virtual] |
Definition at line 14 of file ImageMaterial.cpp.
RGBColor rcrt::ImageMaterial::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 18 of file ImageMaterial.cpp.
References rcrt::ImageTexture::getColor(), rcrt::Intersection::getUV(), and imageTex.
RGBColor rcrt::ImageMaterial::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 23 of file ImageMaterial.cpp.
References rcrt::ImageTexture::getColor(), rcrt::Intersection::getUV(), and imageTex.
RGBColor rcrt::ImageMaterial::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 28 of file ImageMaterial.cpp.
References rcrt::ImageTexture::getColor(), rcrt::Intersection::getUV(), and imageTex.
RGBColor rcrt::ImageMaterial::getEmitted | ( | const Vec3D & | wOut, | |
Intersection & | is | |||
) | [virtual] |
wOut | the outgoing direction. | |
is | The Intersection data. |
Implements rcrt::Material.
Definition at line 33 of file ImageMaterial.cpp.
References rcrt::RGBColor::BLACK.
ScatterEvent rcrt::ImageMaterial::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 38 of file ImageMaterial.cpp.
References rcrt::DIFFUSE, rcrt::ImageTexture::getColor(), rcrt::Vec3D::getCS(), rcrt::Intersection::getPosition(), rcrt::Material::getShadingNormal(), rcrt::Intersection::getUV(), imageTex, rcrt::Vec3D::normalize(), rcrt::Photon::scalePower(), rcrt::Photon::setDir(), rcrt::Photon::setPos(), and rcrt::STORE.
bool rcrt::ImageMaterial::hasDiffuse | ( | ) | const [virtual] |
bool rcrt::ImageMaterial::hasSpecular | ( | ) | const [virtual] |
bool rcrt::ImageMaterial::hasTransmissive | ( | ) | const [virtual] |
ImageTexture* rcrt::ImageMaterial::imageTex [private] |
Definition at line 12 of file ImageMaterial.h.
Referenced by sample(), sampleDiffuse(), sampleSpecular(), and scatterPhoton().