Add my point shaders before I lose them.

This commit is contained in:
Bill Currie 2012-01-04 18:47:03 +09:00
parent 8fbc6221f7
commit bfc743fdcd
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,10 @@
//precision mediump float;
varying float color;
void
main (void)
{
if (color == 1.0)
discard;
gl_FragColor = texture2D (palette, vec2 (pix, 0.5));
}

View File

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