From dc0968bf616a8ab6ccf711c0adc4709bc975f23b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 5 Sep 2020 23:20:48 +0200 Subject: [PATCH] - fixed fog on RRRA E2L1 Fixes #183 --- source/games/duke/src/render.cpp | 2 +- source/glbackend/glbackend.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 36ce08676..e74651c28 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -637,7 +637,7 @@ void displayrooms(int snum, double smoothratio) renderDrawMasks(); } } - GLInterface.SetMapFog(false); + //GLInterface.SetMapFog(false); restoreinterpolations(); if (!isRRRA() || !fogactive) diff --git a/source/glbackend/glbackend.cpp b/source/glbackend/glbackend.cpp index 61ad7d6fc..5a5ddd9b5 100644 --- a/source/glbackend/glbackend.cpp +++ b/source/glbackend/glbackend.cpp @@ -240,7 +240,8 @@ void PolymostRenderState::Apply(FRenderState& state, GLState& oldState) state.EnableFog(1); } else state.EnableFog(0); - state.SetFog((Flags & RF_MapFog) ? PalEntry(0x999999) : FogColor, 21.f); // Fixme: The real density still needs to be implemented. 21 is a reasonable default only. + state.SetFog((GLInterface.useMapFog) ? PalEntry(0x999999) : FogColor, 350.f); // Fixme: The real density still needs to be implemented. 350 is a reasonable default only. + state.SetSoftLightLevel(ShadeDiv >= 1 / 1000.f ? 255 - Scale(Shade, 255, numshades) : 255); state.SetLightParms(VisFactor, ShadeDiv / (numshades - 2)); state.SetTextureMode(TextureMode);