aboutsummaryrefslogtreecommitdiff
path: root/shaders/basic.frag
diff options
context:
space:
mode:
authorJoshua Rahm <joshua.rahm@colorado.edu>2014-04-25 13:09:42 -0600
committerJoshua Rahm <joshua.rahm@colorado.edu>2014-04-25 13:09:42 -0600
commit0c54864f6301a6e0a7bf5553818995fda883bace (patch)
treed9ddf3607234aa4e8c86c7873cd1bcb3dc3fbaeb /shaders/basic.frag
parente3a07ab4ccf65ddf052b483cf879f6a9bdd97720 (diff)
downloadterralloc-0c54864f6301a6e0a7bf5553818995fda883bace.tar.gz
terralloc-0c54864f6301a6e0a7bf5553818995fda883bace.tar.bz2
terralloc-0c54864f6301a6e0a7bf5553818995fda883bace.zip
have first person view
Diffstat (limited to 'shaders/basic.frag')
-rw-r--r--shaders/basic.frag4
1 files changed, 3 insertions, 1 deletions
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);
}