From ba0f09615d6d156b4dbfd5a8f6123d5c3b9b03b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Sat, 18 Feb 2012 10:48:10 +0000 Subject: [PATCH] paysages: Fixed the long-running annoying artifacts on clouds. git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@269 b1fd45b6-86a6-48da-8261-f70d1f35bdcc --- lib_paysages/clouds.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_paysages/clouds.c b/lib_paysages/clouds.c index 021a242..dee1f54 100644 --- a/lib_paysages/clouds.c +++ b/lib_paysages/clouds.c @@ -511,12 +511,16 @@ Color cloudsGetLayerColor(CloudsLayerDefinition* definition, Renderer* renderer, detail = renderer->getPrecision(renderer, start) / definition->scaling; segment_count = _findSegments(definition, renderer, start, direction, detail, 20, definition->transparencydepth, max_length, &inside_length, &total_length, segments); - for (i = 0; i < segment_count; i++) + for (i = segment_count - 1; i >= 0; i--) { col = _applyLayerLighting(definition, renderer, segments[i].start, detail); col.a = (segments[i].length >= definition->transparencydepth) ? 1.0 : (segments[i].length / definition->transparencydepth); colorMask(&result, &col); } + if (inside_length >= definition->transparencydepth) + { + col.a = 1.0; + } result = renderer->applyAtmosphere(renderer, start, result);