1
Fork 0
raytracer/include/lighting.h

13 lines
328 B
C
Raw Normal View History

2020-02-17 10:33:56 -05:00
#pragma once
#include <glm/glm.hpp>
namespace lighting {
inline float point_light(const glm::vec3 pos, const glm::vec3 light, const glm::vec3 normal) {
const glm::vec3 dir = glm::normalize(light - pos);
const float n_dot_l = glm::max(glm::dot(normal, dir), 0.0f);
2020-02-17 10:33:56 -05:00
return n_dot_l;
}
};