Changeset 7c929fc in opengl-game for shaders/ship.frag


Ignore:
Timestamp:
Dec 6, 2019, 4:21:54 AM (5 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
60578ce
Parents:
2b40f48
Message:

In VulkanGame, make lighting work correctly in the ship shader before the MVP matrices are applied

File:
1 edited

Legend:

Unmodified
Added
Removed
  • shaders/ship.frag

    r2b40f48 r7c929fc  
    1515
    1616// reflectance of the object surface
     17// TODO: Eventually, I might want to move these properties into an ssbo so they differ per object
    1718vec3 Ks = vec3(1.0, 1.0, 1.0);
    18 vec3 Kd = vec3(1.0, 0.5, 0.0);
     19vec3 Kd = color;
    1920vec3 Ka = vec3(0.2, 0.2, 0.2);
    2021float specular_exponent = 100.0; // specular 'power'
     
    3132
    3233   // diffuse intensity
    33    vec3 Id = Ld * color * dot_prod;
    34    //vec3 Id = Ld * Kd * dot_prod;
     34   vec3 Id = Ld * Kd * dot_prod;
    3535
    3636   vec3 surface_to_viewer_eye = normalize(-position_eye);
     
    4343   vec3 Is = Ls * Ks * specular_factor;
    4444
    45    //outColor = vec4(Is + Id + Ia, 1.0);
    46    outColor = vec4(color, 1.0);
     45   outColor = vec4(Is + Id + Ia, 1.0);
    4746}
Note: See TracChangeset for help on using the changeset viewer.