Changeset cf2d1e5 in opengl-game for color.frag


Ignore:
Timestamp:
Jun 14, 2018, 3:02:51 AM (7 years ago)
Author:
Dmitry Portnoy <dmp1488@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
885f0bb, 8d5e67b
Parents:
c8dc5c6
git-author:
Dmitry Portnoy <dmp1488@…> (06/14/18 02:58:13)
git-committer:
Dmitry Portnoy <dmp1488@…> (06/14/18 03:02:51)
Message:

-Stop rendering the triangle and square
-Place the player ship at the bottom center of screen, heading up and

into the screen

-Create a method for spawning asteroids and place several in the scene
-Allow the player to move the ship left and right and move the asteroids

towards the ship

File:
1 edited

Legend:

Unmodified
Added
Removed
  • color.frag

    rc8dc5c6 rcf2d1e5  
    66
    77// fixed point light properties
    8 vec3 Ls = vec3(1.0, 1.0, 1.0); // white specular colour
    9 vec3 Ld = vec3(0.7, 0.7, 0.7); // dull white diffuse light colour
    10 vec3 La = vec3(0.2, 0.2, 0.2); // grey ambient colour
     8vec3 Ls = vec3(1.0, 1.0, 1.0);
     9vec3 Ld = vec3(1.0, 1.0, 1.0);
     10vec3 La = vec3(0.2, 0.2, 0.2);
    1111
    1212// surface reflectance
    13 vec3 Ks = vec3(1.0, 1.0, 1.0); // fully reflect specular light
    14 vec3 Kd = vec3(1.0, 0.5, 0.0); // orange diffuse surface reflectance
    15 vec3 Ka = vec3(0.2, 0.2, 0.2); // fully reflect ambient light
     13vec3 Ks = vec3(1.0, 1.0, 1.0);
     14vec3 Kd = vec3(1.0, 1.5, 1.0);
     15vec3 Ka = vec3(0.2, 0.2, 0.2);
    1616float specular_exponent = 100.0; // specular 'power'
    1717
     
    1919  // ambient intensity
    2020  vec3 Ia = La * Ka;
     21
     22  // ambient intensity
     23  vec3 Ia2 = La * Ka;
    2124
    2225  vec3 direction_to_light_eye = normalize(light_position_eye - position_eye);
     
    4649  vec3 Is2 = Ls * Ks * specular_factor2;
    4750
    48   frag_color = vec4(Is + Id + Ia + Is2 + Id2, 1.0);
     51  frag_color = vec4((Is + Id + Ia + Is2 + Id2 + Ia2)/2, 1.0);
    4952}
Note: See TracChangeset for help on using the changeset viewer.