- fixed alpha threshold.

Not only is this a deprecated feature - it also does not work right when complex lighting is at play, it must be done in the shader to get proper results.
This commit is contained in:
Christoph Oelckers 2019-11-10 10:01:31 +01:00
parent 7e70c217fe
commit cae710bd59
14 changed files with 221 additions and 28 deletions

View file

@ -281,7 +281,7 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int
if (TextureType == TT_HICREPLACE)
{
al = ((unsigned)picnum < MAXTILES && alphahackarray[picnum] != 0) ? alphahackarray[picnum] * (1.f / 255.f) :
(tex->alphaThreshold >= 0.f ? tex->alphaThreshold : 0.f);
(tex->alphaThreshold >= 0 ? tex->alphaThreshold * (1.f / 255.f) : 0.f);
}
GLInterface.SetAlphaThreshold(al);
return true;
@ -302,6 +302,7 @@ bool GLInstance::SetNamedTexture(FTexture* tex, int palette, int sampler)
renderState.Flags &= ~RF_UsePalette;
BindTexture(0, mtex, sampler);
GLInterface.SetAlphaThreshold(tex->isTranslucent()? 0.f : 0.5f);
return true;
}