Skip to content

Instantly share code, notes, and snippets.

@wtekteam
Created October 28, 2015 10:51
Show Gist options
  • Save wtekteam/6534054a9cff7880d90a to your computer and use it in GitHub Desktop.
Save wtekteam/6534054a9cff7880d90a to your computer and use it in GitHub Desktop.
A vertex / fragment shader permitting to display vertex color and change its size (OpenGL).
Shader "VertexColorSize" {
SubShader {
Pass {
GLSLPROGRAM
#ifdef VERTEX
varying vec4 v_color;
void main()
{
gl_PointSize = 10.0;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
v_color = gl_Color;
}
#endif
#ifdef FRAGMENT
varying vec4 v_color;
void main()
{
gl_FragColor = v_color;
}
#endif
ENDGLSL
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment