diff options
Diffstat (limited to 'shaders/snow.vert')
-rw-r--r-- | shaders/snow.vert | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/shaders/snow.vert b/shaders/snow.vert new file mode 100644 index 0000000..535c26a --- /dev/null +++ b/shaders/snow.vert @@ -0,0 +1,20 @@ +#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 vec3 in_range ; + +uniform mat4 pjMatrix ; +uniform mat4 mvMatrix ; + +uniform float time ; + +void main() { + float tmp = in_position.y + time ; + float ipart ; + float fpart = modf( tmp, ipart ) ; + float newy = in_range.y - (int(ipart) % int(in_range.y) + fpart) + in_range.x ; + vec3 newp = vec3( in_position.x, newy, in_position.z ) ; + gl_Position = pjMatrix * (mvMatrix * vec4(newp,1.0)) ; +} |