From 0c54864f6301a6e0a7bf5553818995fda883bace Mon Sep 17 00:00:00 2001 From: Joshua Rahm Date: Fri, 25 Apr 2014 13:09:42 -0600 Subject: have first person view --- shaders/basic.frag | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'shaders/basic.frag') diff --git a/shaders/basic.frag b/shaders/basic.frag index a97caf8..61e57bf 100644 --- a/shaders/basic.frag +++ b/shaders/basic.frag @@ -12,6 +12,8 @@ uniform float dY ; uniform mat4 mvMatrix ; uniform mat4 pjMatrix ; +uniform float fog ; + in vec3 normal ; uniform sampler2D textures[8] ; @@ -81,5 +83,5 @@ void main() { float prod = dot( normalize(-newNorm), normalize(vec3(lightPos - position))); vec3 intensity = vec3(prod,prod,max(prod,0.4)) ; - frag_color = vec4(color * intensity,1) * vec4(normalize(globalAmbient.xyz),1.0); + frag_color = vec4(color * intensity / (-position.z*fog+1),1) * vec4(normalize(globalAmbient.xyz),1.0); } -- cgit