diff --git a/core/nullDC.cpp b/core/nullDC.cpp index e770b3c08..89c637803 100755 --- a/core/nullDC.cpp +++ b/core/nullDC.cpp @@ -513,6 +513,7 @@ void InitSettings() settings.rend.CustomTextures = false; settings.rend.DumpTextures = false; settings.rend.ScreenScaling = 100; + settings.rend.Fog = true; settings.pvr.ta_skip = 0; settings.pvr.rend = 0; @@ -595,6 +596,7 @@ void LoadSettings(bool game_specific) settings.rend.DumpTextures = cfgLoadBool(config_section, "rend.DumpTextures", settings.rend.DumpTextures); settings.rend.ScreenScaling = cfgLoadInt(config_section, "rend.ScreenScaling", settings.rend.ScreenScaling); settings.rend.ScreenScaling = min(max(1, settings.rend.ScreenScaling), 100); + settings.rend.Fog = cfgLoadBool(config_section, "rend.Fog", settings.rend.Fog); settings.pvr.ta_skip = cfgLoadInt(config_section, "ta.skip", settings.pvr.ta_skip); settings.pvr.rend = cfgLoadInt(config_section, "pvr.rend", settings.pvr.rend); @@ -718,6 +720,7 @@ void SaveSettings() cfgSaveBool("config", "rend.CustomTextures", settings.rend.CustomTextures); cfgSaveBool("config", "rend.DumpTextures", settings.rend.DumpTextures); cfgSaveInt("config", "rend.ScreenScaling", settings.rend.ScreenScaling); + cfgSaveBool("config", "rend.Fog", settings.rend.Fog); cfgSaveInt("config", "ta.skip", settings.pvr.ta_skip); cfgSaveInt("config", "pvr.rend", settings.pvr.rend); diff --git a/core/rend/gl4/gldraw.cpp b/core/rend/gl4/gldraw.cpp index 3342325d7..21ec3e923 100644 --- a/core/rend/gl4/gldraw.cpp +++ b/core/rend/gl4/gldraw.cpp @@ -153,6 +153,8 @@ template bool two_volumes_mode = (gp->tsp1.full != -1) && Type != ListType_Translucent; bool color_clamp = gp->tsp.ColorClamp && (pvrrc.fog_clamp_min != 0 || pvrrc.fog_clamp_max != 0xffffffff); + int fog_ctrl = settings.rend.Fog ? gp->tsp.FogCtrl : 2; + int depth_func = 0; if (Type == ListType_Translucent) { @@ -169,7 +171,7 @@ template gp->tsp.IgnoreTexA, gp->tsp.ShadInstr, gp->pcw.Offset, - gp->tsp.FogCtrl, + fog_ctrl, two_volumes_mode, depth_func, gp->pcw.Gouraud, diff --git a/core/rend/gles/gldraw.cpp b/core/rend/gles/gldraw.cpp index e735ea99f..d337848cb 100644 --- a/core/rend/gles/gldraw.cpp +++ b/core/rend/gles/gldraw.cpp @@ -173,6 +173,7 @@ __forceinline ShaderUniforms.trilinear_alpha = 1.f; bool color_clamp = gp->tsp.ColorClamp && (pvrrc.fog_clamp_min != 0 || pvrrc.fog_clamp_max != 0xffffffff); + int fog_ctrl = settings.rend.Fog ? gp->tsp.FogCtrl : 2; CurrentShader = GetProgram(Type == ListType_Punch_Through ? 1 : 0, SetTileClip(gp->tileclip, -1) + 1, @@ -181,7 +182,7 @@ __forceinline gp->tsp.IgnoreTexA, gp->tsp.ShadInstr, gp->pcw.Offset, - gp->tsp.FogCtrl, + fog_ctrl, gp->pcw.Gouraud, gp->tcw.PixelFmt == PixelBumpMap, color_clamp, diff --git a/core/types.h b/core/types.h index 9d2e54d4d..a9a835ac1 100644 --- a/core/types.h +++ b/core/types.h @@ -633,6 +633,7 @@ struct settings_t bool CustomTextures; bool DumpTextures; int ScreenScaling; // in percent. 50 means half the native resolution + bool Fog; } rend; struct