#include <PhotonMap.h>
Public Member Functions | |
PhotonMap (Scene *s, const float &maxRadius, const int &maxBounces, const float &flatten=0) | |
virtual | ~PhotonMap () |
void | generate (const int &noPhotons) |
RGBColor | getRadiance (const Vec3D &wOut, const int &noGPhotons, const int &noCPhotons, Intersection &is) |
const float & | getMaxRadius () const |
Private Member Functions | |
void | generateJob (Light *light, std::vector< Photon * > *photons, std::vector< Photon * > *caustics1, const int &noPhotons, int &storedTotal) |
Private Attributes | |
Scene * | scene |
std::vector< Photon * > | photons |
std::vector< Photon * > | caustics |
PhotonKDTree | globalTree |
PhotonKDTree | causticTree |
float | maxRadius |
int | maxBounces |
float | currentRadius |
float | flat |
Definition at line 14 of file PhotonMap.h.
rcrt::PhotonMap::PhotonMap | ( | Scene * | s, | |
const float & | maxRadius, | |||
const int & | maxBounces, | |||
const float & | flatten = 0 | |||
) |
Definition at line 12 of file PhotonMap.cpp.
rcrt::PhotonMap::~PhotonMap | ( | ) | [virtual] |
void rcrt::PhotonMap::generateJob | ( | Light * | light, | |
std::vector< Photon * > * | photons, | |||
std::vector< Photon * > * | caustics1, | |||
const int & | noPhotons, | |||
int & | storedTotal | |||
) | [private] |
Definition at line 141 of file PhotonMap.cpp.
References rcrt::Photon::addBounce(), rcrt::DIFFUSE, rcrt::Light::emitPhoton(), rcrt::Photon::getBounces(), rcrt::Photon::getDir(), rcrt::Material::getIOR(), rcrt::Photon::getPos(), rcrt::Photon::getPower(), rcrt::Scene::intersect(), rcrt::INVALID, maxBounces, rcrt::REFRACTED, rcrt::Material::scatterPhoton(), scene, rcrt::Photon::setDir(), rcrt::Ray::setLastIOR(), rcrt::Photon::setPower(), rcrt::SPECULAR, rcrt::STORE, and rcrt::RGBColor::sum().
Referenced by generate().
void rcrt::PhotonMap::generate | ( | const int & | noPhotons | ) |
Definition at line 24 of file PhotonMap.cpp.
References rcrt::PhotonKDTree::buildTree(), caustics, causticTree, generateJob(), rcrt::Scene::getLights(), rcrt::Photon::getPower(), globalTree, photons, scene, and rcrt::Photon::setWeight().
Referenced by testPhotonRCRT().
RGBColor rcrt::PhotonMap::getRadiance | ( | const Vec3D & | wOut, | |
const int & | noGPhotons, | |||
const int & | noCPhotons, | |||
Intersection & | is | |||
) |
Definition at line 253 of file PhotonMap.cpp.
References causticTree, flat, rcrt::Photon::getDir(), rcrt::PhotonKDTree::getKNearest(), rcrt::Primitive::getMaterial(), rcrt::Intersection::getPosition(), rcrt::Photon::getPower(), rcrt::Intersection::getPrimitive(), rcrt::Material::getShadingNormal(), rcrt::Photon::getWeight(), globalTree, maxRadius, and rcrt::Material::sample().
Referenced by rcrt::PhotonTracer::trace().
const float & rcrt::PhotonMap::getMaxRadius | ( | ) | const |
Scene* rcrt::PhotonMap::scene [private] |
std::vector<Photon*> rcrt::PhotonMap::photons [private] |
std::vector<Photon*> rcrt::PhotonMap::caustics [private] |
PhotonKDTree rcrt::PhotonMap::globalTree [private] |
PhotonKDTree rcrt::PhotonMap::causticTree [private] |
float rcrt::PhotonMap::maxRadius [private] |
int rcrt::PhotonMap::maxBounces [private] |
float rcrt::PhotonMap::currentRadius [private] |
Definition at line 24 of file PhotonMap.h.
float rcrt::PhotonMap::flat [private] |