From 11911a6a5c2823eab167de05c117f96cb61e4589 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Sun, 30 May 2010 22:10:19 +0200 Subject: Fixed the specular lighting Forgot to set the shinyness... --- main.ml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.ml b/main.ml index dbbc3f7..7c3ce77 100644 --- a/main.ml +++ b/main.ml @@ -39,19 +39,20 @@ let _ = (* Some nice articles about lighting: * http://www.sjbaker.org/steve/omniv/opengl_lighting.html - * http://www.spacesimulator.net/tut5_vectors_and_lighting.html *) + * http://www.spacesimulator.net/tut5_vectors_and_lighting.html + * http://www.falloutsoftware.com/tutorials/gl/gl8.htm *) GlDraw.shade_model `smooth; Gl.enable `light0; GlLight.light 0 (`position (1.0, 1.0, 0.0, 1.0)); GlLight.light 0 (`ambient (0.0, 0.0, 0.0, 1.0)); GlLight.light 0 (`diffuse (0.8, 0.8, 0.8, 1.0)); - GlLight.light 0 (`specular (1.0, 1.0, 1.0, 1.0)); + GlLight.light 0 (`specular (0.7, 0.7, 0.7, 1.0)); GlLight.light_model (`ambient (0.2, 0.2, 0.2, 1.0)); Gl.enable `color_material; - (* This doesn't seem to do what I want... GlLight.color_material ~face:`both `ambient_and_diffuse; - GlLight.material ~face:`both (`specular (1.0, 1.0, 1.0, 0.3)); - GlLight.material ~face:`both (`emission (0.0, 0.0, 0.0, 0.3));*) + GlLight.material ~face:`both (`specular (1.0, 1.0, 1.0, 1.0)); + GlLight.material ~face:`both (`shininess 50.0); + GlLight.material ~face:`both (`emission (0.0, 0.0, 0.0, 1.0)); Gl.enable `depth_test; Gl.enable `cull_face; -- cgit v1.2.3