source: opengl-game/texture.vert@ e165b85

feature/imgui-sdl points-test
Last change on this file since e165b85 was 9dd2eb7, checked in by Dmitry Portnoy <dmp1488@…>, 6 years ago

Implement Phong shading in the color and texture shaders

  • Property mode set to 100644
File size: 628 bytes
RevLine 
[ec4456b]1#version 410
2
[7ee66ea]3uniform mat4 model, view, proj;
[93baa0e]4
[d0b9596]5layout(location = 0) in vec3 vertex_position;
[485424b]6layout(location = 1) in vec2 vt;
[9dd2eb7]7layout(location = 2) in vec3 vertex_normal;
[8b7cfcf]8
[485424b]9out vec2 texture_coordinates;
[9dd2eb7]10out vec3 position_eye, normal_eye, light_position_eye;
11
12// fixed point light position
13vec3 light_position_world = vec3(0.0, 0.0, 2.0);
[ec4456b]14
15void main() {
[9dd2eb7]16 position_eye = vec3(view * model * vec4(vertex_position, 1.0));
17 normal_eye = vec3(view * model * vec4 (vertex_normal, 0.0));
[485424b]18 texture_coordinates = vt;
[9dd2eb7]19 light_position_eye = vec3(view * vec4(light_position_world, 1.0));
20
21 gl_Position = proj * vec4(position_eye, 1.0);
[ec4456b]22}
Note: See TracBrowser for help on using the repository browser.