From 0f9e88ccf0510ab4d830529fa539ef6db715f988 Mon Sep 17 00:00:00 2001 From: Julian T Date: Wed, 16 Sep 2020 20:52:12 +0200 Subject: Added first draft of spectral lightning --- src/object.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/object.hpp') diff --git a/src/object.hpp b/src/object.hpp index e697ba2..3b108fb 100644 --- a/src/object.hpp +++ b/src/object.hpp @@ -25,7 +25,7 @@ class Color : public Vec3d { // Implements phong BRDF class Material { public: - Material(Color color, double defuse, double emissive=0); + Material(Color color, double defuse, double spectral=0, double spectral_pow=0, double emissive=0); Color reflect(const Vec3d &normal, const Vec3d &in, const Vec3d &out, const Color &incol) const; @@ -34,11 +34,13 @@ class Material { } // Whether the material is reflective - bool reflects() const { return m_defuse > 0; } + bool reflects() const { return m_defuse+m_spectral > 0; } private: Color m_color; double m_defuse; double m_emissive; + double m_spectral; + double m_spectral_pow; }; class Shape { -- cgit v1.2.3