- fixed fog density of the new renderer.

The actual value needs to be a lot lower than for Polymost due to the different projection.
This commit is contained in:
Christoph Oelckers 2021-04-03 22:51:31 +02:00
parent d7a13fc9f2
commit d71ebace97
5 changed files with 6 additions and 5 deletions

View file

@ -54,7 +54,7 @@
EXTERN_CVAR(Bool, cl_capfps)
PalEntry GlobalMapFog;
float GlobalFogDensity;
float GlobalFogDensity = 350.f;
TArray<PortalDesc> allPortals;

View file

@ -355,3 +355,4 @@ inline float sectorVisibility(sectortype* sec)
return v ? ((uint8_t)(v + 16)) / 16.f : 1.f;
}
inline const float hw_density = 0.35f;

View file

@ -178,7 +178,7 @@ void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
{
state.EnableFog(1);
float density = GlobalMapFog ? GlobalFogDensity : 350.f - Scale(numshades - shade, 150, numshades);
state.SetFog((GlobalMapFog) ? GlobalMapFog : fade, density);
state.SetFog((GlobalMapFog) ? GlobalMapFog : fade, density * hw_density);
state.SetSoftLightLevel(255);
state.SetLightParms(128.f, 1 / 1000.f);
}

View file

@ -129,7 +129,7 @@ void HWSprite::DrawSprite(HWDrawInfo* di, FRenderState& state, bool translucent)
{
state.EnableFog(1);
float density = GlobalMapFog ? GlobalFogDensity : 350.f - Scale(numshades - shade, 150, numshades);
state.SetFog((GlobalMapFog) ? GlobalMapFog : fade, density);
state.SetFog((GlobalMapFog) ? GlobalMapFog : fade, density * hw_density);
state.SetSoftLightLevel(255);
state.SetLightParms(128.f, 1 / 1000.f);
}
@ -161,7 +161,7 @@ void HWSprite::DrawSprite(HWDrawInfo* di, FRenderState& state, bool translucent)
{
// If we get here we know that we have colored fog and no fixed colormap.
float density = GlobalMapFog ? GlobalFogDensity : 350.f - Scale(numshades - shade, 150, numshades);
state.SetFog((GlobalMapFog) ? GlobalMapFog : fade, density);
state.SetFog((GlobalMapFog) ? GlobalMapFog : fade, density * hw_density);
state.SetTextureMode(TM_FOGLAYER);
state.SetRenderStyle(STYLE_Translucent);
state.Draw(DT_TriangleStrip, vertexindex, 4);

View file

@ -131,7 +131,7 @@ void HWWall::SetLightAndFog(FRenderState& state)
{
state.EnableFog(1);
float density = GlobalMapFog ? GlobalFogDensity : 350.f - Scale(numshades - shade, 150, numshades);
state.SetFog((GlobalMapFog) ? GlobalMapFog : fade, density);
state.SetFog((GlobalMapFog) ? GlobalMapFog : fade, density * hw_density);
state.SetSoftLightLevel(255);
state.SetLightParms(128.f, 1 / 1000.f);
}