Minor changes.

This commit is contained in:
2017-02-22 17:10:02 -04:00
parent 18dd3dc3c6
commit 71f520e6d8
2 changed files with 5 additions and 2 deletions

View File

@@ -54,6 +54,10 @@ struct Photon
{
float2rgbe(radiance, red, green, blue);
}
inline void getColor(float & red, float & green, float & blue) {
rgbe2float(red, green, blue, radiance);
}
inline bool equalFloat(const float x, const float y)
{

View File

@@ -8,7 +8,6 @@
#include "photon_tracer.hpp"
#include "sampling.hpp"
#include "area_light.hpp"
#include "rgbe.hpp"
using std::cout;
using std::endl;
@@ -117,7 +116,7 @@ vec3 PhotonTracer::trace_ray(Ray & r, Scene * s, unsigned int rec_level) const {
mx = Vec3(i_pos.x + m_h_radius, i_pos.y + m_h_radius, i_pos.z + m_h_radius);
photons = m_photon_map.findInRange(mn, mx);
for (vector<Photon>::iterator it = photons.begin(); it != photons.end(); it++) {
rgbe2float(red, green, blue, (*it).radiance);
(*it).getColor(red, green, blue);
p_contrib += vec3(red, green, blue);
}
p_contrib /= pi<float>() * (m_h_radius * m_h_radius);