polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

commit 0c376a74dce59ab085ff95e890468268234cf881
parent a261e6002203df4c9540f07cf92d90d652710ae7
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 30 Oct 2018 17:53:40 -0700

blinn-phong

Diffstat:
Metc/shaders/lighting.glsl | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/etc/shaders/lighting.glsl b/etc/shaders/lighting.glsl @@ -31,8 +31,9 @@ vec3 standard_light(vec3 color, vec3 position) { vec3 ambient = ambient_str * sun_color; vec3 view_dir = normalize(camera_position - v_frag_pos); - vec3 reflect_dir = reflect(-light_dir, v_normal); - float spec = pow(max(dot(view_dir, reflect_dir), 0.0), 32.0); + vec3 reflect_dir = normalize(light_dir + view_dir); // blin-phong + // vec3 reflect_dir = reflect(-light_dir, v_normal); // phong + float spec = pow(max(dot(view_dir, reflect_dir), 0.0), 16.0); vec3 specular = spec_str * spec * sun_color;