From: Alexis Laferrière Date: Fri, 22 Jan 2016 21:32:11 +0000 (-0500) Subject: lib/gamnit depth: fix ambient color, multiply with texture X-Git-Tag: v0.8~7^2~9 X-Git-Url: http://nitlanguage.org lib/gamnit depth: fix ambient color, multiply with texture Signed-off-by: Alexis Laferrière --- diff --git a/contrib/model_viewer/assets/models/Quandtum_BA-2_v1_1.mtl b/contrib/model_viewer/assets/models/Quandtum_BA-2_v1_1.mtl index e71b6a4..51e49b9 100644 --- a/contrib/model_viewer/assets/models/Quandtum_BA-2_v1_1.mtl +++ b/contrib/model_viewer/assets/models/Quandtum_BA-2_v1_1.mtl @@ -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 diff --git a/lib/gamnit/depth/more_materials.nit b/lib/gamnit/depth/more_materials.nit index 52191c3..aa9600c 100644 --- a/lib/gamnit/depth/more_materials.nit +++ b/lib/gamnit/depth/more_materials.nit @@ -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;