Added photon tracing.

This commit is contained in:
2017-02-22 15:12:01 -04:00
parent 2efb8b33d4
commit 9bb6c0b759
9 changed files with 188 additions and 38 deletions

View File

@@ -1,7 +1,8 @@
#include "sphere_area_light.hpp"
void SphereAreaLight::sample_at_surface(vec3 point) {
vec3 SphereAreaLight::sample_at_surface() {
Sphere * s = static_cast<Sphere *>(m_figure);
m_last_sample = m_figure->sample_at_surface();
m_n_at_last_sample = normalize(vec3((m_last_sample - s->m_center) / s->m_radius));
return m_last_sample;
}