sphere and disk area lights mostly ready (I think :S).

This commit is contained in:
2017-02-09 23:37:40 -04:00
parent 944ae05db7
commit 0cdc7c46ca
30 changed files with 512 additions and 83 deletions

26
sphere_area_light.hpp Normal file
View File

@@ -0,0 +1,26 @@
#pragma once
#ifndef SPHERE_AREA_LIGHT_HPP
#define SPHERE_AREA_LIGHT_HPP
#include "light.hpp"
#include "sphere.hpp"
class SphereAreaLight: public AreaLight {
public:
float m_const_att;
float m_lin_att;
float m_quad_att;
SphereAreaLight(Sphere * _s, float _c = 1.0, float _l = 0.0, float _q = 0.0):
AreaLight(static_cast<Figure *>(_s)),
m_const_att(_c),
m_lin_att(_l),
m_quad_att(_q)
{ }
virtual vec3 diffuse(vec3 normal, Ray & r, vec3 i_pos, Material & m) const;
virtual vec3 specular(vec3 normal, Ray & r, vec3 i_pos, Material & m) const;
virtual void sample_at_surface(vec3 point);
};
#endif