Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Indexes sent
- { 0, 1, 3, 1, 2, 3 }
- //Attribute 1 (position)
- {
- 0.0f, 0.0f, 0.0f,
- 0.5f, 0.0f, 0.0f,
- 0.5f, 0.5f, 0.0f,
- 0.0f, 0.5f, 0.0f
- }
- //Attribute 2 (color)
- {
- 1.f, 0.f, 0.f,
- 0.f, 1.f, 0.f,
- 0.f, 0.f, 1.f,
- 1.f, 1.f, 1.f
- }
- //Vertex Shader
- #version 400
- layout(location = 0) in vec3 vp;
- layout(location = 1) in vec3 incolor;
- flat out vec3 vert_color;
- void main() {
- gl_Position = vec4(vp, 1.0);
- vert_color = incolor;
- }
- //Frag Shader
- #version 400
- flat in vec3 vert_color;
- out vec4 frag_color;
- void main() {
- frag_color = vec4(vert_color,1.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement