5899a26aad
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14590 178a84e3-b1eb-0310-8ba1-8eac791a3b58
34 lines
738 B
GLSL
34 lines
738 B
GLSL
uniform float screenw;
|
|
uniform float time;
|
|
uniform mat4 viewm;
|
|
uniform vec3 campos;
|
|
|
|
void main()
|
|
{
|
|
const float size = 0.5;
|
|
|
|
// This simulation will run accurately for a bit under five days.
|
|
vec4 start = gl_Vertex;
|
|
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;
|
|
|
|
vec4 eyepos = viewm * start;
|
|
vec4 projCorner = gl_ProjectionMatrix * vec4(vec2(size), eyepos.z, eyepos.w);
|
|
|
|
gl_PointSize = screenw * projCorner.x / projCorner.w;
|
|
gl_Position = gl_ProjectionMatrix * eyepos;
|
|
|
|
gl_TexCoord[0] = gl_MultiTexCoord0;
|
|
}
|