-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbounds_shader.vert
23 lines (18 loc) · 922 Bytes
/
bounds_shader.vert
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#version 330 core
// NOTE: Do NOT use any version older than 330! Bad things will happen!
// This is an example vertex shader. GLSL is very similar to C.
// You can define extra functions if needed, and the main() function is
// called when the vertex shader gets run.
// The vertex shader gets called once per vertex.
layout (location = 0) in vec3 position;
// Uniform variables can be updated by fetching their location and passing values to that location
uniform mat4 projection;
uniform mat4 modelview;
// Outputs of the vertex shader are the inputs of the same name of the fragment shader.
// The default output, gl_Position, should be assigned something. You can define as many
// extra outputs as you need.
void main()
{
// OpenGL maintains the D matrix so you only need to multiply by P, V (aka C inverse), and M
gl_Position = projection * modelview * vec4(position.x, position.y, position.z, 1.0);
}