#version 150
uniform sampler2D tex0;
uniform vec4 color;
in vec4 Vertex_Color;
// This is derived from the age of the particle read
// by the vertex shader
in float intensity;
out vec4 FragColor;
void main (void)
{
  // Blend between red-hot and cool-blue based on the
  // age of the particle.
  //vec4 color = mix(vec4(0.0f, 0.2f, 1.0f, 1.0f),  vec4(1.0f, 0.05f, 0.0f, 1.0f), intensity);
  vec2 uv = gl_PointCoord.xy;
  //vec3 t = texture(tex0,uv).rgb * Vertex_Color.xyz;
  vec3 t = texture(tex0,uv).rgb;
  //FragColor = vec4(t, 1.0) * color;
  FragColor = vec4(t, 1.0) * Vertex_Color * color;
  //FragColor = vec4(1.0, 1.0, 1.0, 1.0);
}
