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