Smoothed opacity in clouds

This commit is contained in:
Michaël Lemaire 2015-09-22 18:17:00 +02:00
parent 273585dd8a
commit 704fe839d9

View file

@ -187,10 +187,16 @@ Color CloudBasicLayerRenderer::getColor(BaseCloudsModel *model, const Vector3 &e
col.a = (segments[i].length >= transparency_depth) ? 1.0 : (segments[i].length / transparency_depth); col.a = (segments[i].length >= transparency_depth) ? 1.0 : (segments[i].length / transparency_depth);
result.mask(col); result.mask(col);
} }
// Opacify when hitting inside_length limit
if (inside_length >= transparency_depth) if (inside_length >= transparency_depth)
{ {
result.a = 1.0; result.a = 1.0;
} }
else if (inside_length >= transparency_depth * 0.8)
{
result.a += (1.0 - result.a) * ((inside_length - transparency_depth * 0.8) / (transparency_depth * 0.2));
}
double a = result.a; double a = result.a;
result = parent->getAtmosphereRenderer()->applyAerialPerspective(start, result).final; result = parent->getAtmosphereRenderer()->applyAerialPerspective(start, result).final;