Changeset 9dd2eb7 in opengl-game for color.vert


Ignore:
Timestamp:
Apr 28, 2018, 2:29:20 AM (6 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
9f4986b
Parents:
d9f99b2
Message:

Implement Phong shading in the color and texture shaders

File:
1 edited

Legend:

Unmodified
Added
Removed
  • color.vert

    rd9f99b2 r9dd2eb7  
    55layout(location = 0) in vec3 vertex_position;
    66layout(location = 1) in vec3 vertex_color;
     7layout(location = 2) in vec3 vertex_normal;
    78
    8 out vec3 color;
     9out vec3 position_eye, normal_eye, color, light_position_eye;
     10
     11// fixed point light position
     12vec3 light_position_world = vec3(0.0, 0.0, 2.0);
    913
    1014void main() {
     15  position_eye = vec3(view * model * vec4(vertex_position, 1.0));
     16  normal_eye = vec3(view * model * vec4 (vertex_normal, 0.0));
    1117  color = vertex_color;
    12   gl_Position = proj * view * model * vec4(vertex_position, 1.0);
     18  light_position_eye = vec3(view * vec4(light_position_world, 1.0));
     19
     20  gl_Position = proj * vec4(position_eye, 1.0);
    1321}
Note: See TracChangeset for help on using the changeset viewer.