summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/egl/opengles2/es2gears.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/egl/opengles2/es2gears.c b/src/egl/opengles2/es2gears.c
index 39dc9a20..4a29c8f5 100644
--- a/src/egl/opengles2/es2gears.c
+++ b/src/egl/opengles2/es2gears.c
@@ -624,10 +624,12 @@ static const char vertex_shader[] =
" // The LightSourcePosition is actually its direction for directional light\n"
" vec3 L = normalize(LightSourcePosition.xyz);\n"
"\n"
+" float diffuse = max(dot(N, L), 0.0);\n"
+" float ambient = 0.2;\n"
+"\n"
" // Multiply the diffuse value by the vertex color (which is fixed in this case)\n"
" // to get the actual color that we will use to draw this vertex with\n"
-" float diffuse = max(dot(N, L), 0.0);\n"
-" Color = diffuse * MaterialColor;\n"
+" Color = (ambient + diffuse) * MaterialColor;\n"
"\n"
" // Transform the position to clip coordinates\n"
" gl_Position = ModelViewProjectionMatrix * vec4(position, 1.0);\n"