Wall portals
Moderator: GZDoom Developers
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: Wall portals
Plane portal in ZDoom is essentially a skybox with dynamic camera. Renders the same way. That much, I know.
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Wall portals
So why does this glitch so much but skyboxes don't?
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Wall portals
Tormentor667 wrote:How hard will it be to make this also work in hardware GZDOOM?
Not much. It's just waiting to be merged.
-
- Posts: 5886
- Joined: Tue Jul 19, 2005 9:06 pm
- Location: New Zealand
Re: Wall portals
Because the skybox camera never moves. The trick is with ZDoom's old portal camera is it offsets the rendering point relative to the portal surface during the render cycle, but this means the point can also be placed behind walls that are otherwise outside the "logical" area. It's pretty much the exact same problem mirrors have.Graf Zahl wrote:So why does this glitch so much but skyboxes don't?
Last edited by edward850 on Mon Jan 25, 2016 2:40 am, edited 2 times in total.
-
- Posts: 13547
- Joined: Wed Jul 16, 2003 3:52 am
Re: Wall portals
This is good news
For ZDoom in general: How far is this from being merged? I imagine a lot of useful situations where you currently have to go crazy with 3d floors, for example creating a building and adding the interior through a portal.
For ZDoom in general: How far is this from being merged? I imagine a lot of useful situations where you currently have to go crazy with 3d floors, for example creating a building and adding the interior through a portal.
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Wall portals
That one's solvable. I had to cope with the same issue in GZDoom as well and managed to work around it. The solution would theoretically be transferrable to ZDoom.edward850 wrote:but this means the point can also be placed behind walls that are otherwise outside the "logical" area. It's pretty much the exact same problem mirrors have.
(In short, it simply marks all subsectors belonging to a portal and if one is encountered during BSP traversal, the corresponding range in the clipper is marked visible. But this requires precise bounding boxes and shapes so it can't be made to work without GL nodes.)
The bigger problem is the 'no upper/lower textures' thing that severely limits what can be done with portals - and of course the performance issue. And even if I'd try to solve it - I'd only do it for linedef-defined portals, the thing-defined portals have been abused so extensively that any attempt to optimize here would break the bigger hack portals lile Urban Brawl.
For mirrors the solution is even easier: Do a simple PointOnLineSide check for each bit of geometry and discard anything that lies behind the mirror. I think the portal branch already implements this.
-
- Posts: 646
- Joined: Mon Aug 17, 2009 11:37 am
- Location: Chule
Re: Wall portals
Correct me if I'm wrong, but didn't ZZYZX try this already? There was a problem with actors placed behind the portal/mirror line causing their sprites to not render properly iirc.Graf Zahl wrote:For mirrors the solution is even easier: Do a simple PointOnLineSide check for each bit of geometry and discard anything that lies behind the mirror. I think the portal branch already implements this.
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Wall portals
Didn't I say this?
-
- Posts: 13547
- Joined: Wed Jul 16, 2003 3:52 am
Re: Wall portals
Sorry for asking again, I am just curiousTormentor667 wrote:For ZDoom in general: How far is this from being merged?
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: Wall portals
He actually asked if zzyzx tried it under the notion that it hadn't worked.Graf Zahl wrote:Didn't I say this?
From looking over the past page, sounds like it's (almost) ready.Tormentor667 wrote:Sorry for asking again, I am just curious
-
- Posts: 13547
- Joined: Wed Jul 16, 2003 3:52 am
Re: Wall portals
This would come at the perfectly right time. Is this working also fluid through flats and not only walls?
-
-
- Posts: 1384
- Joined: Sun Oct 14, 2012 1:43 am
- Location: Ukraine
Re: Wall portals
Graf Zahl wrote:For mirrors the solution is even easier: Do a simple PointOnLineSide check for each bit of geometry and discard anything that lies behind the mirror. I think the portal branch already implements this.
It's in fact three simple PointOnLineSide checks:hfc2x wrote:Correct me if I'm wrong, but didn't ZZYZX try this already? There was a problem with actors placed behind the portal/mirror line causing their sprites to not render properly iirc.
Only lines that lie between the two 2D view rays AND are in front of the portal are drawn. Simple PointOnLineSide was causing various troubles.
Also to implement my method for plane portals, one would just need to calculate point of the portal sector that's closest to the player, and make virtual splitting line that goes through that point and is perpendicular to the player. Then translate this line to actual skybox/portal sector and clip with that, just as if it was a portal line on the picture.
-
- Lead GZDoom+Raze Developer
- Posts: 49130
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Wall portals
In GZDoom I let the clipper (and the hardware stencil) handle the view angle but added a PointOnLineSide check for the actual portal line to exclude the stuff in front of the mirror. I guess in the software renderer it may not be enough because it's lacking the stencil so a bit more work is needed.
-
- Posts: 8193
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: Wall portals
Another thing to consider:
(red line = portal line)
Projectiles and hitscan attacks may want to skip damaging actors that are poking out through walls with a solid backside, if they aren't already.
(red line = portal line)
Projectiles and hitscan attacks may want to skip damaging actors that are poking out through walls with a solid backside, if they aren't already.
-
- Posts: 13547
- Joined: Wed Jul 16, 2003 3:52 am
Re: Wall portals
Is there an explanation btw how to use the line special in this special build? I'd like to test a few things
*EDIT*
Found the first post, was hard to miss
Anyway, a different question: I guess the height of the portal wall is always the whole sector, is this correct? Is it possible to restrict it somehow? For example by setting only the lower or upper texture as a portal?
*EDIT2*
To be more precise, test this one and you will see what I mean and want to achive
https://dl.dropboxusercontent.com/u/546 ... t_t667.wad
*EDIT*
Found the first post, was hard to miss
Anyway, a different question: I guess the height of the portal wall is always the whole sector, is this correct? Is it possible to restrict it somehow? For example by setting only the lower or upper texture as a portal?
*EDIT2*
To be more precise, test this one and you will see what I mean and want to achive
https://dl.dropboxusercontent.com/u/546 ... t_t667.wad