Changeset c8dc5c6 in opengl-game


Ignore:
Timestamp:
Jun 14, 2018, 12:56:57 AM (6 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
cf2d1e5
Parents:
20e0020
Message:

Normalize the surface normals in the shaders.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • color.vert

    r20e0020 rc8dc5c6  
    2222void main() {
    2323  position_eye = vec3(view * model_mats[ubo_index] * vec4(vertex_position, 1.0));
    24   normal_eye = vec3(view * model_mats[ubo_index] * vec4 (vertex_normal, 0.0));
     24  normal_eye = normalize(vec3(view * model_mats[ubo_index] * vec4(vertex_normal, 0.0)));
    2525  color = vertex_color;
    2626  light_position_eye = vec3(view * vec4(light_position_world, 1.0));
  • texture.vert

    r20e0020 rc8dc5c6  
    2222void main() {
    2323  position_eye = vec3(view * model_mats[ubo_index] * vec4(vertex_position, 1.0));
    24   normal_eye = vec3(view * model_mats[ubo_index] * vec4 (vertex_normal, 0.0));
     24  normal_eye = normalize(vec3(view * model_mats[ubo_index] * vec4(vertex_normal, 0.0)));
    2525  texture_coordinates = vt;
    2626  light_position_eye = vec3(view * vec4(light_position_world, 1.0));
Note: See TracChangeset for help on using the changeset viewer.