From 7ded0a6b6fecf9c1d56c1efa591caaa290a4edac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Mon, 18 Jan 2016 19:45:02 +0100 Subject: [PATCH] Removed sun inflating near horizon This is only a popular belief and a psychologically perceived illusion (not optical). --- src/render/opengl/shaders/atmosphere.frag | 2 -- src/render/software/AtmosphereModelBruneton.cpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/render/opengl/shaders/atmosphere.frag b/src/render/opengl/shaders/atmosphere.frag index 4e78922..82d121d 100644 --- a/src/render/opengl/shaders/atmosphere.frag +++ b/src/render/opengl/shaders/atmosphere.frag @@ -90,8 +90,6 @@ vec4 _transmittanceWithShadow(float r, float mu) vec4 _sunTransmittance(vec3 v, vec3 s, float r, float mu, float radius) { vec4 transmittance = r <= Rt ? _transmittanceWithShadow(r, mu) : vec4(1.0); /* T(x,xo) */ - float d = _limit(r, mu); - radius *= (1.0 + 15.0 * d / Rt); /* Inflating due to lens effect near horizon */ float isun = step(cos(radius), dot(v, s)) * ISun; /* Lsun */ transmittance.r *= isun; transmittance.g *= isun; diff --git a/src/render/software/AtmosphereModelBruneton.cpp b/src/render/software/AtmosphereModelBruneton.cpp index 65b0055..fe2e32d 100644 --- a/src/render/software/AtmosphereModelBruneton.cpp +++ b/src/render/software/AtmosphereModelBruneton.cpp @@ -860,8 +860,6 @@ static Color _getInscatterColor(Vector3 *_x, double *_t, Vector3 v, Vector3 s, d /* direct sun light for ray x+tv, when sun in direction s (=L0) */ 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 + 15.0 * d / Rt); /* Inflating due to lens effect near horizon */ double isun = step(cos(radius), v.dotProduct(s)) * ISun; /* Lsun */ transmittance.r *= isun; transmittance.g *= isun;