2020-02-17 10:33:56 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <glm/glm.hpp>
|
|
|
|
|
|
|
|
namespace lighting {
|
2020-05-29 22:11:03 -04:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
};
|