From ab30fb2e5e7315e92ed004f21923de6da9eceaa2 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 12 Jun 2025 17:08:09 +0200 Subject: [PATCH] check if seg has any texture at all seems to work even better and less "false positives" also removing some redundant conditons --- src/r_segs.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 76b0b7ea0..a4f384af4 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -2415,21 +2415,20 @@ void R_StoreWallRange(INT32 start, INT32 stop) } else { - // for everyone that sees this + // for anyone that sees this // dont. // this is absolute shit-tier hacks // but i just cant determine this in any sane way // but this checks a shitton of things to make software handle skies better - const bool emptymid = (!midtexture && !curline->sidedef->midtexture && !curline->polyseg); - auto set_topstep_normal = [&] { topstep = -FixedMul (rw_scalestep, worldtop); topfrac = (centeryfrac>>4) - FixedMul (worldtop, rw_scale); }; - if (emptymid) + // untextured seg + if (!segtextured && !curline->polyseg) { const bool tophigh = (backsector && worldhigh <= worldtop && worldhighslope <= worldtopslope) && (worldhigh != worldtop || worldhighslope != worldtopslope); @@ -2437,17 +2436,15 @@ void R_StoreWallRange(INT32 start, INT32 stop) // if we cant see the goddamn skyplane, well there wont be any skybox // we could kill skyVisible instead, but i want to keep the performance improvemnts it yields // so we do this absolute trash - if ((frontsector->floorpic != skyflatnum && frontsector->ceilingpic != skyflatnum) - && ((!backsector && frontsector->ceilingpic != skyflatnum && frontsector->floorpic != skyflatnum) - || (tophigh && (frontsector->ceilingpic != skyflatnum) - && (backsector->floorheight > frontsector->ceilingheight || backsector->ceilingheight < frontsector->floorheight)))) + if ((frontsector->floorpic != skyflatnum && frontsector->ceilingpic != skyflatnum) // try to guess if its a "window" + && ((!backsector) // single sided + || (tophigh && (backsector->floorheight > frontsector->ceilingheight || backsector->ceilingheight < frontsector->floorheight)))) // check if there is a "thok" sector behind it skyVisible = true; // this is an attempt to fix issues with textureless midtextures drawing nothing where they should just draw sky instead if ((newview->sky // only do this for skyrender - && viewz < P_GetSectorCeilingZAt(frontsector, viewx, viewy) // looks ugly while our cam is in the sky - && ((!backsector && frontsector->ceilingpic == skyflatnum && frontsector->floorpic != skyflatnum) - || (tophigh && (backsector->ceilingpic == skyflatnum && frontsector->ceilingpic != skyflatnum))))) + && ((!backsector && frontsector->ceilingpic == skyflatnum) // single sided line with sky ceiling + || (tophigh && (backsector->ceilingpic == skyflatnum && frontsector->ceilingpic != skyflatnum))))) // double sided with back ceiling sky but not front ceiling sky { topstep = -FixedMul (rw_scalestep, worldbottom); topfrac = (centeryfrac>>4) - FixedMul (worldbottom, rw_scale);