KlassischeKeplerKriege/game/renderer_polygon_3d/particle.frag

15 lines
348 B
GLSL
Raw Normal View History

2016-09-29 02:24:14 +00:00
R"raw_string(
#version 120
varying vec2 vertex;
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;
gl_FragColor = vec4(1.0/max(1.0, decay), 1.0/max(1.0, 6.0*decay), 0.0, 1.0);
}
)raw_string"