diff options
author | HampusM <hampus@hampusmat.com> | 2025-01-21 17:58:18 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-01-21 17:58:18 +0100 |
commit | 912ce3cc3890c698793691caa13c29df0723e16f (patch) | |
tree | c7fc7ea03ab0b71f07ea9c9f0f5daf189b6a6cf3 /engine/src/renderer/opengl/glsl | |
parent | 6249b9e2f450257e71baafb7af4a47c4eccaeb9e (diff) |
feat(engine): use blinn-phong lighting instead of phong lighting
Diffstat (limited to 'engine/src/renderer/opengl/glsl')
-rw-r--r-- | engine/src/renderer/opengl/glsl/light.glsl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engine/src/renderer/opengl/glsl/light.glsl b/engine/src/renderer/opengl/glsl/light.glsl index 1bc23a4..f12b5fe 100644 --- a/engine/src/renderer/opengl/glsl/light.glsl +++ b/engine/src/renderer/opengl/glsl/light.glsl @@ -80,10 +80,10 @@ vec3 calc_specular_light( { vec3 view_direction = normalize(view_pos - frag_pos); - vec3 reflect_direction = reflect(-light_dir, norm); + vec3 halfway_direction = normalize(light_dir + view_direction); float spec = - pow(max(dot(view_direction, reflect_direction), 0.0), material.shininess); + pow(max(dot(norm, halfway_direction), 0.0), material.shininess); return light_phong.specular * ( spec * (vec3(texture(material.specular_map, texture_coords)) * material.specular) |