1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 06:53:53 +00:00

Clamp alpha reference to avoid degenerate case

This commit is contained in:
AnyOldName3 2021-01-01 16:01:33 +00:00
parent 54853380cd
commit 9b99c76032

View file

@ -15,7 +15,7 @@ uniform float alphaRef;
void alphaTest()
{
#if @alphaToCoverage
float coverageAlpha = (gl_FragData[0].a - alphaRef) / max(fwidth(gl_FragData[0].a), 0.0001) + 0.5;
float coverageAlpha = (gl_FragData[0].a - clamp(alphaRef, 0.0001, 0.9999)) / max(fwidth(gl_FragData[0].a), 0.0001) + 0.5;
// Some functions don't make sense with A2C or are a pain to think about and no meshes use them anyway
// Use regular alpha testing in such cases until someone complains.