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
This commit is contained in:
Michaël Lemaire 2012-02-18 10:48:10 +00:00 committed by ThunderK
parent 36b6943ea4
commit ba0f09615d

View file

@ -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);