diff --git a/doomsday/apps/client/src/render/rend_main.cpp b/doomsday/apps/client/src/render/rend_main.cpp index 6b1a039b54..48f5b73a6d 100644 --- a/doomsday/apps/client/src/render/rend_main.cpp +++ b/doomsday/apps/client/src/render/rend_main.cpp @@ -735,6 +735,15 @@ ClientMaterial *Rend_ChooseMapSurfaceMaterial(Surface const &surface) const Line::Side &side = surface.parent().as(); if (side.hasSector()) { + if (auto *midAnim = side.middle().materialAnimator()) + { + DENG2_ASSERT(&surface != &side.middle()); + if (!midAnim->isOpaque()) + { + return &midAnim->material(); + } + } + // Use the ceiling for missing top section, and floor for missing bottom section. if (&surface == &side.bottom()) { @@ -3278,6 +3287,15 @@ static bool coveredOpenRange(HEdge &hedge, coord_t middleBottomZ, coord_t middle { LineSide const &front = hedge.mapElementAs().lineSide(); + // TNT map02 window grille: transparent masked wall + if (auto *anim = front.middle().materialAnimator()) + { + if (!anim->isOpaque()) + { + return false; + } + } + if (front.considerOneSided()) { return wroteOpaqueMiddle; @@ -3315,7 +3333,7 @@ static bool coveredOpenRange(HEdge &hedge, coord_t middleBottomZ, coord_t middle if (wroteOpaqueMiddle && middleCoversOpening) return true; - if ( (bceil <= ffloor && (front.top ().hasMaterial() || front.middle().hasMaterial())) + if ( (bceil <= ffloor && (front.top ().hasMaterial() || front.middle().hasMaterial())) || (bfloor >= fceil && (front.bottom().hasMaterial() || front.middle().hasMaterial()))) { Surface const &ffloorSurface = subsec.visFloor ().surface(); @@ -3397,7 +3415,8 @@ static void writeAllWalls(HEdge &hedge) } } } - ClientApp::renderSystem().angleClipper().addRangeFromViewRelPoints(hedge.origin(), hedge.twin().origin()); + ClientApp::renderSystem().angleClipper() + .addRangeFromViewRelPoints(hedge.origin(), hedge.twin().origin()); } } @@ -3532,25 +3551,11 @@ static void occludeSubspace(bool frontFacing) auto const &backSubsec = backSubspace.subsector().as(); // Determine the opening between plane heights at this edge. - ddouble openBottom; - if (backSubsec.visFloor().heightSmoothed() > subsec.visFloor().heightSmoothed()) - { - openBottom = backSubsec.visFloor().heightSmoothed(); - } - else - { - openBottom = subsec.visFloor().heightSmoothed(); - } + ddouble openBottom = de::max(backSubsec.visFloor().heightSmoothed(), + subsec .visFloor().heightSmoothed()); - ddouble openTop; - if (backSubsec.visCeiling().heightSmoothed() < subsec.visCeiling().heightSmoothed()) - { - openTop = backSubsec.visCeiling().heightSmoothed(); - } - else - { - openTop = subsec.visCeiling().heightSmoothed(); - } + ddouble openTop = de::min(backSubsec.visCeiling().heightSmoothed(), + subsec .visCeiling().heightSmoothed()); // Choose start and end vertexes so that it's facing forward. Vertex const &from = frontFacing ? hedge->vertex() : hedge->twin().vertex(); diff --git a/doomsday/apps/client/src/render/wallspec.cpp b/doomsday/apps/client/src/render/wallspec.cpp index 04920c2764..185998a515 100644 --- a/doomsday/apps/client/src/render/wallspec.cpp +++ b/doomsday/apps/client/src/render/wallspec.cpp @@ -19,12 +19,12 @@ #include "de_base.h" +#include "MaterialAnimator" #include "Sector" #include "Surface" #include "world/p_players.h" // viewPlayer #include "render/rend_main.h" - #include "render/walledge.h" using namespace de; @@ -62,6 +62,15 @@ WallSpec WallSpec::fromMapSide(LineSide const &side, dint section) // static spec.flags |= WallSpec::NoEdgeDivisions; } + // TNT MAP02 window grille: transparent masked wall + if (auto *midMan = side.middle().materialAnimator()) + { + if (section != LineSide::Middle && !midMan->isOpaque()) + { + spec.flags &= ~WallSpec::ForceOpaque; + } + } + if (isTwoSidedMiddle) { if (viewPlayer &&