attribute vec3 position;
attribute vec3 color;
uniform mat4 modelViewProjectionMatrix;
varying vec3 col;
void main()
{
gl_Position = modelViewProjectionMatrix * vec4(position, 1.0);
gl_PointSize = max( 200.0 / gl_Position.w, 1.0);
col = color;
}
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
uniform sampler2D tex;
varying vec3 col;
void main()
{
vec2 texCoord = clamp(gl_PointCoord, 0.01, 0.99);
vec4 texColor = texture2D(tex, texCoord);
gl_FragColor = vec4(texColor.rgb * col, texColor.a);
}