diff options
| author | Josh Rahm <joshuarahm@gmail.com> | 2022-12-03 02:18:25 -0700 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-12-03 02:18:25 -0700 |
| commit | ecf90db5ffada1890e759c5a7e91c13ec15a02bd (patch) | |
| tree | bb102d9d8aeeecdb6d36b63a5b5ec0623d2d8f4d /shaders/snow.vert | |
| parent | d7fb5d4551a93b4756db62f494b761c0cef2fda7 (diff) | |
| parent | a60702dd882768e7f5b7fcadd39253ac8de9114f (diff) | |
| download | terralloc-ecf90db5ffada1890e759c5a7e91c13ec15a02bd.tar.gz terralloc-ecf90db5ffada1890e759c5a7e91c13ec15a02bd.tar.bz2 terralloc-ecf90db5ffada1890e759c5a7e91c13ec15a02bd.zip | |
Merge remote-tracking branch 'origin/snow'
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)) ; +} |