Skip to content

Instantly share code, notes, and snippets.

@thomastraum
Created June 4, 2012 01:56
Show Gist options
  • Save thomastraum/2865874 to your computer and use it in GitHub Desktop.
Save thomastraum/2865874 to your computer and use it in GitHub Desktop.
vertex + fragment pointsprites
#version 120
uniform sampler2D texture;
varying vec4 mycol;
void main(void)
{
gl_FragColor = texture2D(texture,gl_PointCoord) * mycol;
}
#version 120
attribute float point_size;
attribute vec4 col;
varying vec4 mycol;
void main()
{
// gl_PointSize = point_size;
gl_Position = ftransform();
gl_PointSize = point_size / (gl_Position.w * 0.001 );
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_FrontColor = gl_Color;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
vec4 eyePos = gl_ModelViewMatrix * gl_Vertex;
gl_FogFragCoord = abs(eyePos.z/eyePos.w);
mycol = col;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment