From 680a8e8c327d05c882f01f208fabff0bb9907ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Fri, 16 Dec 2011 18:13:50 +0000 Subject: [PATCH] paysages: Small clouds lighting improvement. git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@193 b1fd45b6-86a6-48da-8261-f70d1f35bdcc --- src/clouds.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/clouds.c b/src/clouds.c index b820bc2..963aa84 100644 --- a/src/clouds.c +++ b/src/clouds.c @@ -403,6 +403,8 @@ static Color _applyLayerLighting(CloudsDefinition* definition, CloudsQuality* qu Color result; normal = _getNormal(definition, position, 0.5); + normal = v3Add(normal, _getNormal(definition, position, 0.2)); + normal = v3Add(normal, _getNormal(definition, position, 0.1)); result = lightingApply(position, normal, 0.0, base, 0.3, 0.1); direction = sun_direction_inv; @@ -416,9 +418,9 @@ static Color _applyLayerLighting(CloudsDefinition* definition, CloudsQuality* qu inside_depth = 1.0; } - result.r = base.r * sun_color_lum * (0.9 - 0.2 * inside_depth) + result.r * 0.2 * inside_depth + (0.1 - inside_depth * 0.1) * sun_color_lum; - result.g = base.g * sun_color_lum * (0.9 - 0.2 * inside_depth) + result.g * 0.2 * inside_depth + (0.1 - inside_depth * 0.1) * sun_color_lum; - result.b = base.b * sun_color_lum * (0.9 - 0.2 * inside_depth) + result.b * 0.2 * inside_depth + (0.1 - inside_depth * 0.1) * sun_color_lum; + result.r = base.r * sun_color_lum * (0.9 - 0.2 * inside_depth) + result.r * (0.1 + 0.1 * inside_depth) + (0.1 - inside_depth * 0.1) * sun_color_lum; + result.g = base.g * sun_color_lum * (0.9 - 0.2 * inside_depth) + result.g * (0.1 + 0.1 * inside_depth) + (0.1 - inside_depth * 0.1) * sun_color_lum; + result.b = base.b * sun_color_lum * (0.9 - 0.2 * inside_depth) + result.b * (0.1 + 0.1 * inside_depth) + (0.1 - inside_depth * 0.1) * sun_color_lum; return result; }