redef var vertex_shader_source = """
// Coordinates of particle effects
attribute vec4 center;
// Particles color tint
attribute vec4 color;
varying vec4 v_color;
// Per particle scaling
attribute float scale;
// Model view projection matrix
uniform mat4 mvp;
// Time-to-live of each particle
attribute float ttl;
// Creation time of each particle
attribute float ot;
// Current time
uniform float t;
void main()
{
// Pass varyings to the fragment shader
v_color = color;
float dt = t - ot;
float pt = dt/ttl;
// Discard expired or not yet created particles
if (dt > ttl || dt < 0.0) {
gl_PointSize = 0.0;
return;
}
{{{vertex_shader_core}}}
}
"""
lib/gamnit/depth/particles.nit:172,2--211,5