mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
- 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:
parent
d7a13fc9f2
commit
d71ebace97
5 changed files with 6 additions and 5 deletions
|
@ -54,7 +54,7 @@
|
|||
EXTERN_CVAR(Bool, cl_capfps)
|
||||
|
||||
PalEntry GlobalMapFog;
|
||||
float GlobalFogDensity;
|
||||
float GlobalFogDensity = 350.f;
|
||||
TArray<PortalDesc> allPortals;
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue