Skip to content

Instantly share code, notes, and snippets.

@feliwir
Created March 2, 2015 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save feliwir/c70fd440401ddf36d9ac to your computer and use it in GitHub Desktop.
Save feliwir/c70fd440401ddf36d9ac to your computer and use it in GitHub Desktop.
#version 330 core
layout(location = 0) in vec3 pos;
layout(location = 1) in vec3 color;
out vec3 fragmentColor;
// Values that stay constant for the whole mesh.
uniform mat4 MVP;
void main()
{
// Output position of the vertex, in clip space : MVP * position
gl_Position = MVP * vec4(pos,1.0f);
// The color of each vertex will be interpolated
// to produce the color of each fragment
fragmentColor = color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment