From 970c750daa8bcf9f0ace7bb153198b488f4f32e1 Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Fri, 11 Nov 2016 18:08:47 +0800 Subject: [PATCH 1/2] Added OpenGL support to the underwater view blend scalar option. --- src/gl/scene/gl_scene.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index b53be4aaa..1437d3fd5 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -82,6 +82,7 @@ CVAR(Bool, gl_sort_textures, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) EXTERN_CVAR (Bool, cl_capfps) EXTERN_CVAR (Bool, r_deathcamera) +EXTERN_CVAR (Float, underwater_fade_scalar) extern int viewpitch; @@ -602,7 +603,11 @@ void FGLRenderer::DrawBlend(sector_t * viewsector) } else if (blendv.a) { - V_AddBlend(blendv.r / 255.f, blendv.g / 255.f, blendv.b / 255.f, blendv.a / 255.0f, blend); + // [Nash] allow user to set blend intensity + int cnt = blendv.a; + cnt = (int)(cnt * underwater_fade_scalar); + + V_AddBlend(blendv.r / 255.f, blendv.g / 255.f, blendv.b / 255.f, cnt / 255.0f, blend); } } From b3b5cb2fa410554edb095fb0515ed6cc17098145 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 17 Nov 2016 23:13:17 +0100 Subject: [PATCH 2/2] - fixed: Lines with both sides in the same sector but an active portal may not be discarded early. --- src/gl/scene/gl_bsp.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/gl/scene/gl_bsp.cpp b/src/gl/scene/gl_bsp.cpp index 7b9830050..f0ddfd642 100644 --- a/src/gl/scene/gl_bsp.cpp +++ b/src/gl/scene/gl_bsp.cpp @@ -140,12 +140,15 @@ static void AddLine (seg_t *seg, bool portalclip) { if (currentsector->sectornum == seg->backsector->sectornum) { - FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::mid)); - if (!tex || tex->UseType==FTexture::TEX_Null) + if (!seg->linedef->isVisualPortal()) { - // nothing to do here! - seg->linedef->validcount=validcount; - return; + FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::mid)); + if (!tex || tex->UseType==FTexture::TEX_Null) + { + // nothing to do here! + seg->linedef->validcount=validcount; + return; + } } backsector=currentsector; }