Added presentations from EVI 2017
This commit is contained in:
29
EVI - 2017/EVI 21/EVIray/directional_light.cpp
Normal file
29
EVI - 2017/EVI 21/EVIray/directional_light.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <limits>
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/constants.hpp>
|
||||
|
||||
#include "directional_light.hpp"
|
||||
|
||||
using std::numeric_limits;
|
||||
using glm::pi;
|
||||
using glm::reflect;
|
||||
using glm::dot;
|
||||
using glm::pow;
|
||||
using glm::max;
|
||||
|
||||
vec3 DirectionalLight::direction(vec3 point) const {
|
||||
return m_position;
|
||||
}
|
||||
|
||||
float DirectionalLight::distance(vec3 point) const {
|
||||
return numeric_limits<float>::max();
|
||||
}
|
||||
|
||||
vec3 DirectionalLight::diffuse(vec3 normal, Ray & r, vec3 i_pos, Material & m) const {
|
||||
return m.m_brdf->diffuse(m_position, normal, r, i_pos, m_diffuse);
|
||||
}
|
||||
|
||||
vec3 DirectionalLight::specular(vec3 normal, Ray & r, vec3 i_pos, Material & m) const {
|
||||
return m.m_brdf->specular(m_position, normal, r, i_pos, m_specular, m.m_shininess);
|
||||
}
|
Reference in New Issue
Block a user