Added sun inflation near horizon

This commit is contained in:
Michaël Lemaire 2013-06-03 21:51:01 +02:00
parent 6355de2e5e
commit 41cc8787ac

View file

@ -922,6 +922,8 @@ static Color _getInscatterColor(Vector3* _x, double* _t, Vector3 v, Vector3 s, d
static Color _sunColor(Vector3 v, Vector3 s, double r, double mu, double radius)
{
Color transmittance = r <= Rt ? _transmittanceWithShadow(r, mu) : COLOR_WHITE; /* T(x,xo) */
double d = _limit(r, mu);
radius *= (1.0 + 10.0 * d / Rt); /* Inflating due to lens effect near horizon */
double isun = step(cos(radius * M_PI / 180.0), v3Dot(v, s)) * ISun; /* Lsun */
transmittance.r *= isun;
transmittance.g *= isun;