source:
opengl-game/laser.vert@
99d44b2
Last change on this file since 99d44b2 was fd6f465, checked in by , 6 years ago | |
---|---|
|
|
File size: 491 bytes |
Rev | Line | |
---|---|---|
[b155f13] | 1 | #version 410 |
2 | ||
[fd6f465] | 3 | #define MAX_NUM_OBJECTS 1024 |
4 | ||
[b155f13] | 5 | uniform mat4 view, proj; |
6 | ||
[fd6f465] | 7 | layout (std140) uniform models { |
8 | mat4 model_mats[MAX_NUM_OBJECTS]; | |
9 | }; | |
10 | ||
[b155f13] | 11 | layout(location = 0) in vec3 vertex_position; |
[9f9f9a7] | 12 | layout(location = 1) in vec2 vt; |
[fd6f465] | 13 | layout(location = 2) in uint ubo_index; |
[b155f13] | 14 | |
[9f9f9a7] | 15 | out vec2 texture_coordinates; |
16 | out vec3 position_eye; | |
[b155f13] | 17 | |
18 | void main() { | |
[fd6f465] | 19 | position_eye = vec3(view * model_mats[ubo_index] * vec4(vertex_position, 1.0)); |
[9f9f9a7] | 20 | texture_coordinates = vt; |
[b155f13] | 21 | |
22 | gl_Position = proj * vec4(position_eye, 1.0); | |
23 | } |
Note:
See TracBrowser
for help on using the repository browser.