Skip to content

Commit

Permalink
Add more check before rendering fog.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Feb 22, 2024
1 parent db7642f commit bfc4a5a
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Plugins/Renderer/gl_rmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,25 @@ cvar_t *r_alpha_shift = NULL;
cvar_t *r_additive_shift = NULL;

/*
Purpose : Check if we are rendering with Fog
Purpose : Check if we can render fog
*/

bool R_CanRenderFog()
{
if (!(*r_refdef.onlyClientDraws))
return false;

if (CL_IsDevOverviewMode())
return false;

if (r_draw_reflectview)
return false;

return true;
}

/*
Purpose : Check if we are rendering with fog
*/

bool R_IsRenderingFog()
Expand Down Expand Up @@ -3335,7 +3353,7 @@ void R_SetupFrame(void)

R_DisableRenderingFog();

if (!r_draw_reflectview && !(*r_refdef.onlyClientDraws))
if (R_CanRenderFog())
{
if ((*cl_waterlevel) > 2)
{
Expand Down

0 comments on commit bfc4a5a

Please sign in to comment.