Added emissive color to material.

This commit is contained in:
Miguel Angel Astor Romero
2017-01-17 17:20:58 -04:00
parent 8d341b9a25
commit 965b04ca39
3 changed files with 3 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ using glm::vec3;
class Material { class Material {
public: public:
vec3 m_emission;
vec3 m_diffuse; vec3 m_diffuse;
vec3 m_specular; vec3 m_specular;
float m_rho; float m_rho;

View File

@@ -116,7 +116,7 @@ vec3 PathTracer::trace_ray(Ray & r, vector<Figure *> & v_figures, vector<Light *
} }
// Return final color. // Return final color.
return color; return _f->m_mat->m_emission + color;
} else { } else {
if (e != NULL) if (e != NULL)

View File

@@ -85,7 +85,7 @@ vec3 WhittedTracer::trace_ray(Ray & r, vector<Figure *> & v_figures, vector<Ligh
} }
// Return final color. // Return final color.
return color; return _f->m_mat->m_emission + color;
} else { } else {
if (e != NULL) if (e != NULL)