attribute float age;
attribute float state;
varying float fAge;
varying float fState;
void main() {
fAge = age;
fState = state;
gl_PointSize = 3.0;
gl_Position = projectionMatrix *
modelViewMatrix *
vec4(position, 1.0);
}
varying float fAge;
varying float fState;
void main() {
if (fState < 0.5) {
gl_FragColor = vec4(0, 0, 0, 0);
return;
}
if (fAge < 0.1) {
gl_FragColor = vec4(1.0, (1.0 - fAge * 6.0), 1.0 - (fAge * 10.0), 1.0);
} else {
gl_FragColor = vec4(1.0 - fAge, (1.0 - fAge) * 0.4, 0, 0.75);
}
}
attribute float age;
attribute float state;
varying float fAge;
varying float fState;
void main() {
fAge = age;
fState = state;
gl_PointSize = 10.0 + 15.0 * age * age;
gl_Position = projectionMatrix *
modelViewMatrix *
vec4(position, 1.0);
}
varying float fAge;
varying float fState;
uniform sampler2D texture1;
void main() {
if (fState < 0.5) {
gl_FragColor = vec4(0, 0, 0, 0);
return;
}
vec4 texColor = texture2D(texture1, gl_PointCoord);
gl_FragColor = vec4(texColor.xyz, texColor.w * (0.4 - 0.3 * fAge));
}