15 lines
348 B
GLSL
15 lines
348 B
GLSL
|
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"
|