Photon mapping can be executed now. Buggy as heck.

This commit is contained in:
2017-02-22 16:23:33 -04:00
parent 9bb6c0b759
commit 18dd3dc3c6
5 changed files with 132 additions and 26 deletions

View File

@@ -7,8 +7,8 @@
class PhotonTracer: public Tracer {
public:
PhotonTracer(): Tracer() { }
PhotonTracer(unsigned int max_depth): Tracer(max_depth) { };
PhotonTracer(): Tracer(), m_h_radius(0.5f) { }
PhotonTracer(unsigned int max_depth, float _r = 0.5f): Tracer(max_depth), m_h_radius(_r) { };
virtual ~PhotonTracer();
virtual vec3 trace_ray(Ray & r, Scene * s, unsigned int rec_level) const;
@@ -16,6 +16,7 @@ public:
void build_photon_map(Scene * s, const size_t n_photons_per_ligth = 10000, const bool specular = false);
private:
float m_h_radius;
kdTree m_photon_map;
vec3 trace_photon(Ray &r, Scene * s, const unsigned int rec_level, const bool specular = false);
};