diff options
author | HampusM <hampus@hampusmat.com> | 2023-11-27 20:02:08 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-11-27 20:02:08 +0100 |
commit | c230f5aaea3df46ae9a4d7c1c9761e55ef827b82 (patch) | |
tree | 9e429a33df6e12f4b2f9adf87d08dad2a0127756 /engine/fragment-color.glsl | |
parent | 935f35455ac2e3547cdd21cd4596538958a7217e (diff) |
feat(engine): add lighting maps
Diffstat (limited to 'engine/fragment-color.glsl')
-rw-r--r-- | engine/fragment-color.glsl | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/engine/fragment-color.glsl b/engine/fragment-color.glsl deleted file mode 100644 index 4213860..0000000 --- a/engine/fragment-color.glsl +++ /dev/null @@ -1,28 +0,0 @@ -#version 330 core - -#preinclude "light.glsl" - -out vec4 FragColor; - -in vec3 in_frag_color; -in vec3 in_frag_pos; -in vec3 in_normal; - -uniform vec3 view_pos; - -void main() -{ - vec3 ambient_light = calc_ambient_light(); - - vec3 light_direction = normalize(light.position - in_frag_pos); - vec3 norm = normalize(in_normal); - - vec3 diffuse_light = calc_diffuse_light(light_direction, norm); - - vec3 specular_light = - calc_specular_light(light_direction, norm, view_pos, in_frag_pos); - - FragColor = - vec4((ambient_light + diffuse_light + specular_light) * in_frag_color, 1.0); -} - |