Vic Posted November 21, 2021 Hi, I've got a question regarding how exactly the renderer in Doom works. As most of us here know, in general it works like this: traverse the BSP tree, drawing + clip the segments in front-to-back order and then fill in the rest by drawing visplanes. Supposedly that achieves zero overdraw, except... when it doesn't. Let's slightly re-order the operations: 1) traverse the BSP tree 2) clip the segments into visplanes 3) render visplanes 4) render segments Now, this works totally fine most of the time except for there's a door that goes below the player's floor level. As an example, look at the bottom of the secret door, that's partially hidden by imps corpses. You can it see shining through the floor. This is how it's supposed to look: Now I'm wondering whether has anyone come across this problem and if there's an easy fix for the renderer that would properly clip the door's bottom level to the floor. Any help would be much appreciated. 2 Quote Share this post Link to post
RjY Posted November 21, 2021 Good question. I wish I understood the renderer better. I do recall a PrBoom commit from 2007 fixing an overdraw issue, perhaps it is relevant: ------------------------------------------------------------------------ r2419 | proff_fs | 2007-01-30 09:13:48 +0000 (Tue, 30 Jan 2007) | 3 lines Added missing clipping. Very noticeable in Doom2 Demo3 in Map 26 in the elevators when you remove the call to R_DrawPlanes. Thanks to SoM for this! diff --git a/src/r_segs.c b/src/r_segs.c index 67e5e8b7..cb30b75b 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -298,6 +298,8 @@ static void R_RenderSegLoop (void) ceilingplane->top[rw_x] = top; ceilingplane->bottom[rw_x] = bottom; } + // SoM: this should be set here + ceilingclip[rw_x] = bottom; } // yh = bottomfrac>>HEIGHTBITS; @@ -316,6 +318,8 @@ static void R_RenderSegLoop (void) floorplane->top[rw_x] = top; floorplane->bottom[rw_x] = bottom; } + // SoM: This should be set here to prevent overdraw + floorclip[rw_x] = top; } // texturecolumn and lighting are independent of wall tiers ------------------------------------------------------------------------ On the other hand, the error in your screenshot looks like a broken sector reference, a side of a line facing the wrong sector. If you are willing to post the map, or otherwise verify that it is correct, that would be a useful sanity check. It is hard to debug from screenshots alone :). 2 Quote Share this post Link to post
Vic Posted November 22, 2021 An interesting find, thanks! I wonder whether the fix is applicable to calico/3do/32x ports.. As far as the map goes, I forwarded your question to our mapping expert - Wavy, although last time I asked him, he said there was nothing of unusual or suspect there. 0 Quote Share this post Link to post
kalensar Posted November 22, 2021 The only thing I took away from this is that the OP is complaining about a secret door texture not matching the rest of the wall. Last time I checked it was pretty common and acceptable practice to use off patterned texturing to mark secrets. That said, both screen shots are absolutely horrible for conveying the asserted problem. I can't even notice a blemish in that pixelated mess, and I would definitely check that spot for a Secret. 0 Quote Share this post Link to post
SMG_Man Posted November 22, 2021 (edited) 17 minutes ago, kalensar said: The only thing I took away from this is that the OP is complaining about a secret door texture not matching the rest of the wall. That's not the problem; what's happening is that the hidden door's texture is clipping through the floor. It's something I've seen a lot with mid-textures working in vanilla; for example, let's say I wanted a railing using the MIDGRATE texture, but I only want to use like the top half of it so it doesn't go all the way up to the ceiling. I could try doing something like this in doombuilder: Looks fine, right? But when I open the map in-game: You can see the lower half of the texture clipping through the floor in a completely unintended manner. This is pretty much what's happening up there, only with the lower part of the hidden door being drawn through the floor. Edited November 22, 2021 by SMG_Man 1 Quote Share this post Link to post
Vic Posted November 22, 2021 2 hours ago, kalensar said: That said, both screen shots are absolutely horrible for conveying the asserted problem. I can't even notice a blemish in that pixelated mess, and I would definitely check that spot for a Secret. This is how Doom looks on the 32X, not much can be done about that! 1 Quote Share this post Link to post
kalensar Posted November 22, 2021 1 minute ago, Vic said: This is how Doom looks on the 32X, not much can be done about that! You could have moved closer to the wall =P But yeah I get where you are coming from. I have GZDoom, LZDoom, ZDoom, Zandronum, PrBoom+, and Odamex mainly for mod compatibility. Basically just depends on my mood for how for how I want to play. If I want super vanilla software mode Usually run ZDoom. 0 Quote Share this post Link to post
Vic Posted November 22, 2021 4 minutes ago, kalensar said: You could have moved closer to the wall =P I wish I could - that was the closest point I managed to get it glitching at.. Moving closer magically fixed the clipping issue :D 1 Quote Share this post Link to post
JadingTsunami Posted November 22, 2021 14 minutes ago, Vic said: I wish I could - that was the closest point I managed to get it glitching at.. Moving closer magically fixed the clipping issue :D You should be able to work around this by "forcing" a split by putting the midtexture inside its own sector. It can be self-referencing (if it's in the middle of an existing sector) or a new sector with a different height. Tried locally and it does work. 0 Quote Share this post Link to post
kalensar Posted November 22, 2021 17 minutes ago, Vic said: I wish I could - that was the closest point I managed to get it glitching at.. Moving closer magically fixed the clipping issue :D Part of the diagnosing definitely has to do with which source port you are using because stuff like GZDoom will autocorrect texture alignment in many cases; whereas Chocolate doom will not. If that's on DosDoom then there's literally no helping it honestly other than in the Builder of choice. I've even seen Zdoom 2.8 render better than GZDoom software rendering in a few cases. 0 Quote Share this post Link to post
Vic Posted November 23, 2021 (edited) Well, I'm not trying to fix the map, which is absolutely fine by all standards, but the renderer in my source port, which in turn is based on the Jaguar port. There's definitely some missing clipping there, most likely inherited from the vanilla. Edited November 23, 2021 by Vic 0 Quote Share this post Link to post
VGA Posted December 1, 2021 @kalensar I don't think you have understood that the OP has ported Doom (again) to the 32x and is trying to fix the rendering of his source port. 1 Quote Share this post Link to post
Vic Posted February 6, 2022 I've recorded two videos that demonstrate the problem. It seems to be strictly related to doors that go below the floor level. 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.