KlassischeKeplerKriege/data/shader/particle.frag

16 lines
401 B
GLSL
Raw Normal View History

2016-09-29 02:24:14 +00:00
#version 120
varying vec2 vertex;
2016-09-29 07:05:35 +00:00
varying vec2 velocity;
2016-09-29 02:24:14 +00:00
uniform float maxAge;
uniform float time;
void main()
{
//gl_FragColor = vec4(0.5+0.5*vertex.x, 0.5+0.5*vertex.y, 0.0, 1.0);
if (length(vertex) > 1.0) {
discard;
}
float decay = time / maxAge;
2016-09-29 07:05:35 +00:00
decay = 5.0*decay*decay;
// (length(10.0*velocity));
2016-09-29 02:24:14 +00:00
gl_FragColor = vec4(1.0/max(1.0, decay), 1.0/max(1.0, 6.0*decay), 0.0, 1.0);
2016-09-29 10:28:35 +00:00
}