Changeset cf2d1e5 in opengl-game for color.frag
- Timestamp:
- Jun 14, 2018, 3:02:51 AM (7 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
color.frag
rc8dc5c6 rcf2d1e5 6 6 7 7 // fixed point light properties 8 vec3 Ls = vec3(1.0, 1.0, 1.0); // white specular colour9 vec3 Ld = vec3( 0.7, 0.7, 0.7); // dull white diffuse light colour10 vec3 La = vec3(0.2, 0.2, 0.2); // grey ambient colour8 vec3 Ls = vec3(1.0, 1.0, 1.0); 9 vec3 Ld = vec3(1.0, 1.0, 1.0); 10 vec3 La = vec3(0.2, 0.2, 0.2); 11 11 12 12 // surface reflectance 13 vec3 Ks = vec3(1.0, 1.0, 1.0); // fully reflect specular light14 vec3 Kd = vec3(1.0, 0.5, 0.0); // orange diffuse surface reflectance15 vec3 Ka = vec3(0.2, 0.2, 0.2); // fully reflect ambient light13 vec3 Ks = vec3(1.0, 1.0, 1.0); 14 vec3 Kd = vec3(1.0, 1.5, 1.0); 15 vec3 Ka = vec3(0.2, 0.2, 0.2); 16 16 float specular_exponent = 100.0; // specular 'power' 17 17 … … 19 19 // ambient intensity 20 20 vec3 Ia = La * Ka; 21 22 // ambient intensity 23 vec3 Ia2 = La * Ka; 21 24 22 25 vec3 direction_to_light_eye = normalize(light_position_eye - position_eye); … … 46 49 vec3 Is2 = Ls * Ks * specular_factor2; 47 50 48 frag_color = vec4( Is + Id + Ia + Is2 + Id2, 1.0);51 frag_color = vec4((Is + Id + Ia + Is2 + Id2 + Ia2)/2, 1.0); 49 52 }
Note:
See TracChangeset
for help on using the changeset viewer.