1
Fork 0
raytracer/include/lighting.h
2022-08-16 07:41:12 -04:00

12 lines
342 B
C++

#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);
return n_dot_l;
}
}; // namespace lighting