Added sun inflation near horizon
This commit is contained in:
parent
6355de2e5e
commit
41cc8787ac
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
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) */
|
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 */
|
double isun = step(cos(radius * M_PI / 180.0), v3Dot(v, s)) * ISun; /* Lsun */
|
||||||
transmittance.r *= isun;
|
transmittance.r *= isun;
|
||||||
transmittance.g *= isun;
|
transmittance.g *= isun;
|
||||||
|
|
Loading…
Reference in a new issue