3D floors ... again (impossible comes true)

Moderator: GZDoom Developers

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: 3D floors ... again (impossible comes true)

Post by Graf Zahl »

I don't want to do that because it would create visual discrepancies between 3D floors and sector floors, especially if they are next to each other. I think there's easier ways to do this. All you need is change the bottom clipping coordinate but I can't make any sense of the code so I don't know where to do it.
kgsws-CZ
Posts: 70
Joined: Sun Jul 19, 2009 9:50 pm

Re: 3D floors ... again (impossible comes true)

Post by kgsws-CZ »

All sprite clipping is in R_DrawSprite, follow sclipBottom and sclipTop, these are current clipping heights.
But i think i have idea how to do that, i will try after sleep.
kgsws-CZ
Posts: 70
Joined: Sun Jul 19, 2009 9:50 pm

Re: 3D floors ... again (impossible comes true)

Post by kgsws-CZ »

Ok, here is best i can do.
3df006.zip
Fixed:
- sprite/Psprite fake lighting

Added:
- ignore clipping on solid opaque fake floors/ceilings

It does check only sprites in sector with fake floors, not touching ones.
Spoiler:
And there is another "bug".
Spoiler:
Also, it does not check fake sector height, that means it won't clip cyberdemon in tiny space. (like in real sector)
You do not have the required permissions to view the files attached to this post.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: 3D floors ... again (impossible comes true)

Post by Graf Zahl »

Nothing worse than what's present for regular floors I'd say.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: 3D floors ... again (impossible comes true)

Post by Graf Zahl »

I did some checks with the new code and I think this is as good as the software renderer can possibly get. I consider the feature finished and fully implemented now so once Randy drops a line I wouldn't mind merging it into the trunk now.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm

Re: 3D floors ... again (impossible comes true)

Post by randi »

Graf Zahl wrote:I did some checks with the new code and I think this is as good as the software renderer can possibly get.
Except for slopes. I did some thinking about that today, and the way to do it, I think, would be to draw the subsectors and real planes as now, but when adding sprites, clip them to the current subsector. Then the masked textures can be drawn by sorting sprites and fake floors within each subsector and drawing them in the reverse order the subsectors were drawn. Since sprite/fake floor sorting would be per sector, sloped fake floors support should be automatic. And sprites wouldn't need to be clipped against every single opening, either, so it might be faster even without fake floors.
koverhbarc
Posts: 230
Joined: Mon Dec 06, 2010 6:26 am

Re: 3D floors ... again (impossible comes true)

Post by koverhbarc »

Graf Zahl wrote:I did some checks with the new code and I think this is as good as the software renderer can possibly get.
Except possibly for speed. When I played that Burghead MAP110, I noticed that the slowdown dependes essentially on the angle I was facing, being roughly 50x over no 3D floors when looking at the center of the building. My distance from it didn't matter much, and even when I couldn't see the house (on the path) it slowed to a crawl when facing that direction. I'm guessing that the 3D floors are all being rendered even when blocked by walls, and are not clipped off by the BSP as they should be.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: 3D floors ... again (impossible comes true)

Post by Graf Zahl »

I never got below 40 fps during my tests with Nimrod and HTH2 - and I consider those the real deal. So yes, it costs some performance, of course, due to overdraw but in realistic situations it's not too bad. Most portal setups I've seen are worse and people still use those, too.
User avatar
cq75
Posts: 1212
Joined: Sun Dec 27, 2009 9:28 pm
Graphics Processor: nVidia with Vulkan support
Location: Just beyond the line horizon

Re: 3D floors ... again (impossible comes true)

Post by cq75 »

I haven't visited this topic in a while, I'm impressed guys, I didn't think this would get worked out so soon!
User avatar
Nash
 
 
Posts: 17512
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: 3D floors ... again (impossible comes true)

Post by Nash »

Can a kind soul put up a binary of the latest 3dfloors2? I'd really like to see the new clipping code in action.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space

Re: 3D floors ... again (impossible comes true)

Post by NeuralStunner »

kgsws-CZ wrote:And there is another "bug".
Spoiler:
Actually, I seem to remember vanilla doing this sometimes.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm

Re: 3D floors ... again (impossible comes true)

Post by Xaser »

If the player's viewpoint is higher than the ledge (i.e. you can see over the top), then the sprite isn't clipped. Looks like normal behavior in that shot.
User avatar
KCMGAW
Posts: 28
Joined: Tue Aug 28, 2007 5:32 pm

Re: 3D floors ... again (impossible comes true)

Post by KCMGAW »

NeuralStunner wrote:
kgsws-CZ wrote:And there is another "bug".
Spoiler:
Actually, I seem to remember vanilla doing this sometimes.
I have seen this in Vanilla, Software Zdoom, GZDoom's OpenGL renderer even. It's not really a bug so much as sometimes it happens to render like that. Even the PSX port had sprite clipping issues at very very rare moments.

---

This is a useful feature (understatement as I've been craving this since like... forever) and once it's finalized I'm going to have practical use for these. Not that I will overdo it :P

I applaud all who worked on this so far. Keep up the good work.
User avatar
Nash
 
 
Posts: 17512
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: 3D floors ... again (impossible comes true)

Post by Nash »

Okay so I finally tried the latest version. Other than its inability to render slopes (yet), I'd say it's perfect. Actually I think it's amazing! Right down to the clipping, the collision and all... everything works as expected.

This - plus voxels - is as 3-d as it gets for the software renderer!

So I can't help but wonder... what was it EXACTLY that kgsws-CZ managed to figure out that neither Randy nor Graf couldn't figure out for past several years? Please don't take this post wrongly, I mean no offense... but it's just that 3-d floors in the software renderer has been rejected so many times throughout the years (I'm sure this has been brought up ever since the Notgod phorums at least)... I felt that it was generally accepted that 3-d floors in the software renderer is so darn difficult to pull off - otherwise it would have already been done a long time ago correct? So I'm just wondering what magic did kgsws-CZ managed to pull off that suddenly it works... I'm sure it's not easy at all, and I can't say that a detailed and technical explanation would be something I can grasp but I'm still curious as to how he did it anyway - what exactly did he did right in the code until 3-d floors actually work in the software renderer.
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space

Re: 3D floors ... again (impossible comes true)

Post by NeuralStunner »

I don't know if it was a matter of "couldn't figure it out" nearly so much as "had other priorities". Once someone's actually done a lot of the work, there's something to build off of. Plus it means someone was interested enough in the feature to work on it themselves, which is inspiring too. :)

Return to “Closed Feature Suggestions [GZDoom]”