quakeforge/libs/video/renderer/glsl/quakepnt.vert
Bill Currie 5e1a80e016 Implement particles as points.
Unfortunately, the maximum point size on Intel hardwar seems to be 1, so I
can't tell if the colors are right.

This is largely just a hacked version of GL's particle code.
2012-01-19 10:39:03 +09:00

19 lines
305 B
GLSL

uniform mat4 mvp_mat;
attribute float vcolor;
/** Vertex position.
x, y, z, c
c is the color of the point.
*/
attribute vec3 vertex;
varying float color;
void
main (void)
{
gl_Position = mvp_mat * vec4 (vertex, 1.0);
gl_PointSize = max (1, 32768.0 * abs (1.0 / gl_Position.z));
color = vcolor;
}