lib/gamnit depth: fix ambient color, multiply with texture
authorAlexis Laferrière <alexis.laf@xymus.net>
Fri, 22 Jan 2016 21:32:11 +0000 (16:32 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 25 Jan 2016 16:54:33 +0000 (11:54 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/model_viewer/assets/models/Quandtum_BA-2_v1_1.mtl
lib/gamnit/depth/more_materials.nit

index e71b6a4..51e49b9 100644 (file)
@@ -3,7 +3,7 @@
 
 newmtl Bot
 Ns 96.078431
-Ka 0.000000 0.000000 0.000000
+Ka 1.000000 1.000000 1.000000
 Kd 0.640000 0.640000 0.640000
 Ks 1.000000 1.000000 1.000000
 Ni 1.000000
index 52191c3..aa9600c 100644 (file)
@@ -317,7 +317,7 @@ class LambertProgram
                        float lambert = max(dot(light_dir, v_normal), 0.0);
 
                        if (use_map_ambient)
-                               gl_FragColor = ambient_color + texture2D(map_ambient, v_tex_coord);
+                               gl_FragColor = ambient_color * texture2D(map_ambient, v_tex_coord);
                        else
                                gl_FragColor = ambient_color;