feature/imgui-sdl
points-test
Last change
on this file since e165b85 was e165b85, checked in by Dmitry Portnoy <dmp1488@…>, 7 years ago |
Start incorporating UBOs
|
-
Property mode
set to
100644
|
File size:
671 bytes
|
Rev | Line | |
---|
[ec4456b] | 1 | #version 410
|
---|
| 2 |
|
---|
[7ee66ea] | 3 | uniform mat4 model, view, proj;
|
---|
[93baa0e] | 4 |
|
---|
[e165b85] | 5 | layout (std140) uniform shader_data {
|
---|
| 6 | mat4 model_mat;
|
---|
| 7 | };
|
---|
| 8 |
|
---|
[d0b9596] | 9 | layout(location = 0) in vec3 vertex_position;
|
---|
| 10 | layout(location = 1) in vec3 vertex_color;
|
---|
[9dd2eb7] | 11 | layout(location = 2) in vec3 vertex_normal;
|
---|
[8b7cfcf] | 12 |
|
---|
[9dd2eb7] | 13 | out vec3 position_eye, normal_eye, color, light_position_eye;
|
---|
| 14 |
|
---|
| 15 | // fixed point light position
|
---|
| 16 | vec3 light_position_world = vec3(0.0, 0.0, 2.0);
|
---|
[ec4456b] | 17 |
|
---|
| 18 | void main() {
|
---|
[9dd2eb7] | 19 | position_eye = vec3(view * model * vec4(vertex_position, 1.0));
|
---|
| 20 | normal_eye = vec3(view * model * vec4 (vertex_normal, 0.0));
|
---|
[8b7cfcf] | 21 | color = vertex_color;
|
---|
[9dd2eb7] | 22 | light_position_eye = vec3(view * vec4(light_position_world, 1.0));
|
---|
| 23 |
|
---|
| 24 | gl_Position = proj * vec4(position_eye, 1.0);
|
---|
[ec4456b] | 25 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.