From 41cc8787ac4e30ca072192b7388bf3ba2a4ec79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Mon, 3 Jun 2013 21:51:01 +0200 Subject: [PATCH] Added sun inflation near horizon --- src/rendering/atmosphere/atm_bruneton.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rendering/atmosphere/atm_bruneton.c b/src/rendering/atmosphere/atm_bruneton.c index 64f93ab..1549948 100644 --- a/src/rendering/atmosphere/atm_bruneton.c +++ b/src/rendering/atmosphere/atm_bruneton.c @@ -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;