diff options
author | Joshua Rahm <joshua.rahm@colorado.edu> | 2014-04-17 22:08:15 -0600 |
---|---|---|
committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2014-04-17 22:08:15 -0600 |
commit | 73daf65aaa31b5fb59f4a91d9185387f63c7b09f (patch) | |
tree | 681036c0cdd6f7981164ac189fed92da900ee3e7 /shaders/basic.vert | |
parent | e083553a455d30374f21aa0c34d9ae827470d490 (diff) | |
download | terralloc-73daf65aaa31b5fb59f4a91d9185387f63c7b09f.tar.gz terralloc-73daf65aaa31b5fb59f4a91d9185387f63c7b09f.tar.bz2 terralloc-73daf65aaa31b5fb59f4a91d9185387f63c7b09f.zip |
added real water
Diffstat (limited to 'shaders/basic.vert')
-rw-r--r-- | shaders/basic.vert | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/shaders/basic.vert b/shaders/basic.vert new file mode 100644 index 0000000..e1abeb5 --- /dev/null +++ b/shaders/basic.vert @@ -0,0 +1,27 @@ +#version 150 +#extension GL_ARB_explicit_attrib_location : enable +#extension GL_ARB_explicit_uniform_location : enable + +layout(location = 0) in vec3 in_position ; +layout(location = 2) in vec4 in_color ; +layout(location = 1) in vec3 in_normal ; +layout(location = 3) in vec2 in_texcoord ; + +layout(location = 4) uniform mat4 pjMatrix ; +layout(location = 5) uniform mat4 mvMatrix ; +layout(location = 7) uniform mat3 normalMatrix ; + +out vec2 texcoord ; +out vec4 position ; +out vec3 normal ; + +out float texture_blend[8] ; + +void main() { + gl_Position = pjMatrix * (position = mvMatrix * vec4(in_position,1.0)) ; + texcoord = in_texcoord ; + normal = normalMatrix * in_normal ; + for ( int i = 0 ; i < 8 ; ++ i ) + texture_blend[i] = 0 ; + texture_blend[int(clamp(round(in_color.a),0,8))] = 1.0 ; +} |