26 lines
No EOL
549 B
GLSL
26 lines
No EOL
549 B
GLSL
#version 120
|
|
attribute vec2 in_vertex;
|
|
attribute vec2 in_position;
|
|
attribute vec2 in_velocity;
|
|
|
|
uniform float maxAge;
|
|
varying float decay;
|
|
varying vec2 velocity;
|
|
varying vec2 vertex;
|
|
uniform float time;
|
|
uniform float size;
|
|
void main()
|
|
{
|
|
//decay = min(1.0, time+5.0*length(velocity)) / maxAge;
|
|
//decay = max(decay*decay, sqrt(decay));
|
|
decay = time / maxAge;
|
|
|
|
vec2 base = in_vertex;
|
|
vec2 p = size*base;
|
|
p += log(1.0+time) * in_velocity;
|
|
p += in_position;
|
|
gl_Position = vec4(p, 0.0, 1.0);
|
|
|
|
vertex = base;
|
|
velocity = in_velocity;
|
|
} |