diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-11-17 15:07:56 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2010-11-17 15:09:43 -0800 |
commit | be26855affd33f1a5458b57ff31dea48b9bf66d8 (patch) | |
tree | 72019c5632ca75b2144b52548bc24c7abba38155 | |
parent | 4da64513401741de42d065e64ff5ce31243dd7a8 (diff) |
Small fragment shader changes.
-rwxr-xr-x | src/phong.frag | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/phong.frag b/src/phong.frag index d2b74a3..c44ebf5 100755 --- a/src/phong.frag +++ b/src/phong.frag @@ -58,13 +58,14 @@ void main(void) vec3 h = normalize(l + v); vec3 n = perturbed_normal(); vec3 i = reflect(eye_ss, n); - //vec3 diff = base_color * dot(n, l); + vec3 diff = base_color * dot(n, l); float spec = pow(dot(n, h), s); float F = schlick(n, l); - vec4 envir = textureCube(sampler, reflect(eye_direction_ws, normal_ws)); + vec4 envir = textureCube(sampler, reflect(normalize(eye_direction_ws), normal_ws)); gl_FragColor = (1 - F) * envir + F * vec4(spec); + //gl_FragColor = step(0.0, dot(n, l)) * vec4(diff + vec3(spec), 1.0) + F * envir; } //gl_FragColor = vec4((1 - F) * diff + F * vec3(spec), 1.0); |