This commit is contained in:
Rachael Alexanderson 2017-01-01 10:54:19 -05:00
commit c7dce79831
18 changed files with 4637 additions and 27 deletions

View file

@ -56,6 +56,7 @@ struct FColormap
LightColor = from->Color;
desaturation = from->Desaturate;
FadeColor = from->Fade;
FadeColor.a = 0;
blendfactor = from->Color.a;
fogdensity = from->Fade.a*2;
return * this;

View file

@ -296,11 +296,10 @@ void GLSprite::Draw(int pass)
if (!gl_isBlack(Colormap.FadeColor))
{
float dist=Dist2(ViewPos.X, ViewPos.Y, x,y);
if (!Colormap.FadeColor.a) Colormap.FadeColor.a=clamp<int>(255-lightlevel,60,255);
int fogd = gl_GetFogDensity(lightlevel, Colormap.FadeColor, Colormap.fogdensity);
// this value was determined by trial and error and is scale dependent!
float factor=0.05f+exp(-Colormap.FadeColor.a*dist/62500.f);
float factor = 0.05f + exp(-fogd*dist / 62500.f);
fuzzalpha*=factor;
minalpha*=factor;
}
@ -387,6 +386,7 @@ void GLSprite::Draw(int pass)
FColormap thiscm;
thiscm.FadeColor = Colormap.FadeColor;
thiscm.fogdensity = Colormap.fogdensity;
thiscm.CopyFrom3DLight(&(*lightlist)[i]);
if (glset.nocoloredspritelighting)
{