KlassischeKeplerKriege/game/renderer_polygon_3d/particle.frag
2016-09-29 09:05:35 +02:00

18 lines
No EOL
428 B
JavaScript

R"raw_string(
#version 120
varying vec2 vertex;
varying vec2 velocity;
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;
decay = 5.0*decay*decay;
// (length(10.0*velocity));
gl_FragColor = vec4(1.0/max(1.0, decay), 1.0/max(1.0, 6.0*decay), 0.0, 1.0);
}
)raw_string"