aboutsummaryrefslogtreecommitdiff
path: root/shaders/water.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/water.frag
parente3a07ab4ccf65ddf052b483cf879f6a9bdd97720 (diff)
downloadterralloc-0c54864f6301a6e0a7bf5553818995fda883bace.tar.gz
terralloc-0c54864f6301a6e0a7bf5553818995fda883bace.tar.bz2
terralloc-0c54864f6301a6e0a7bf5553818995fda883bace.zip
have first person view
Diffstat (limited to 'shaders/water.frag')
-rw-r--r--shaders/water.frag3
1 files changed, 2 insertions, 1 deletions
diff --git a/shaders/water.frag b/shaders/water.frag
index 6c2aa2b..6e32796 100644
--- a/shaders/water.frag
+++ b/shaders/water.frag
@@ -12,6 +12,7 @@ uniform sampler2D texture ;
uniform sampler2D skytex ;
uniform sampler2D skynight ;
uniform vec4 lightpos ;
+uniform float fog ;
in vec3 normal ;
in vec4 position ;
@@ -79,6 +80,6 @@ void main() {
// frag_color = vec4( 0,0,1, 1.0 );
// frag_color = vec4(tex_x,tex_y,0,1.0) ;
// vec4 color = sample(0,0);
- frag_color = vec4(vec3(refcolor) * vec3(0.6,0.8,1.0),0.95) * vec4(normalize(globalAmbient.xyz),1.0);
+ frag_color = vec4(vec3(refcolor) * vec3(0.6,0.8,1.0) / (-position.z*fog+1),0.95) * vec4(normalize(globalAmbient.xyz),1.0);
// frag_color = vec4(0,0,1,0.8) ;
}