Created
October 28, 2015 10:51
-
-
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).
This file contains 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
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