Created
June 4, 2012 01:56
-
-
Save thomastraum/2865874 to your computer and use it in GitHub Desktop.
vertex + fragment pointsprites
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
uniform sampler2D texture; | |
varying vec4 mycol; | |
void main(void) | |
{ | |
gl_FragColor = texture2D(texture,gl_PointCoord) * mycol; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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