- disable palette emulation when map global fog is active.

This doesn't work well together and is pointless anyway as everything needs to be rendered at full brightness.
Fixes #99
This commit is contained in:
Christoph Oelckers 2020-10-03 18:04:07 +02:00
parent f8caf88089
commit ddc968f607
2 changed files with 2 additions and 5 deletions

View file

@ -502,6 +502,7 @@ void displayrooms(int snum, double smoothratio)
if (sect < 0 || sect >= MAXSECTORS) return;
GLInterface.SetMapFog(fogactive != 0);
if (fogactive) hw_int_useindexedcolortextures = false;
dointerpolations(smoothratio);
setgamepalette(BASEPAL);
@ -672,6 +673,7 @@ void displayrooms(int snum, double smoothratio)
}
else p->visibility = ud.const_visibility;
}
if (fogactive) hw_int_useindexedcolortextures = hw_useindexedcolortextures;
}
bool GameInterface::GenerateSavePic()

View file

@ -54,11 +54,6 @@ vec4 ProcessTexel()
palettedColor.a = color.r == 0.0? 0.0 : 1.0;// 1.0-floor(color.r);
color = palettedColor;
if (uFogDensity != 0.0) // fog hack for RRRA E2L1. Needs to be done better, this is gross, but still preferable to the broken original implementation.
{
float fogfactor = 0.55 + 0.3 * exp2 (uFogDensity * abs(z) / 1024.0);
color.rgb = uFogColor.rgb * (1.0-fogfactor) + color.rgb * fogfactor;// mix(vec3(0.6), color.rgb, fogfactor);
}
if (color.a < uAlphaThreshold) discard; // it's only here that we have the alpha value available to be able to perform the alpha test.
return vec4(color.rgb, 1.0);
}