Slightly improved cloud lighting
This commit is contained in:
parent
704fe839d9
commit
ba02442fea
1 changed files with 10 additions and 8 deletions
|
@ -176,13 +176,11 @@ Color CloudBasicLayerRenderer::getColor(BaseCloudsModel *model, const Vector3 &e
|
||||||
|
|
||||||
col = parent->applyLightingToSurface(segments[i].start, parent->getAtmosphereRenderer()->getSunDirection(), material);
|
col = parent->applyLightingToSurface(segments[i].start, parent->getAtmosphereRenderer()->getSunDirection(), material);
|
||||||
|
|
||||||
double power = col.getPower();
|
// Boost highly lighted area
|
||||||
if (power > 0.2)
|
double boost = 1.0 + (col.getPower() * col.getPower());
|
||||||
{
|
col.r *= boost;
|
||||||
col.r += (power - 0.2) * 1.5;
|
col.g *= boost;
|
||||||
col.g += (power - 0.2) * 1.5;
|
col.b *= boost;
|
||||||
col.b += (power - 0.2) * 1.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
||||||
|
@ -235,9 +233,13 @@ bool CloudBasicLayerRenderer::alterLight(BaseCloudsModel *model, LightComponent*
|
||||||
{
|
{
|
||||||
factor = 1.0;
|
factor = 1.0;
|
||||||
}
|
}
|
||||||
|
else if (factor > 0.00001)
|
||||||
|
{
|
||||||
|
factor = sqrt(factor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
double miminum_light = 0.3;
|
double miminum_light = 0.5;
|
||||||
factor = 1.0 - (1.0 - miminum_light) * factor;
|
factor = 1.0 - (1.0 - miminum_light) * factor;
|
||||||
|
|
||||||
light->color.r *= factor;
|
light->color.r *= factor;
|
||||||
|
|
Loading…
Reference in a new issue