stk-code_catmod/data/shaders/rainsim.vert
vincentlj 9826af0747 Rain: Avoid making a draw call that won't be used and make some cleanup
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14811 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-12-27 16:37:24 +00:00

30 lines
588 B
GLSL

#version 130
uniform float time;
uniform vec3 campos;
uniform mat4 viewm;
in vec3 initialPosition;
out vec3 currentPosition;
void main()
{
// This simulation will run accurately for a bit under five days.
vec4 start = vec4(initialPosition, 1.0);
start.y -= time;
// How many times has it fell?
float count = floor(start.y / 24.0);
start.x += sin(count);
start.z += cos(count);
vec2 signs = sign(start.xz);
start.xz = mod(start.xz, 17.5) * signs;
start.y = mod(start.y, 24.0) - 3.0;
start.xyz += campos;
currentPosition = (viewm * start).xyz;
gl_Position = vec4(0.);
}