Wall portals

Moderator: GZDoom Developers

User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine

Re: Wall portals

Post by ZZYZX »

Plane portal in ZDoom is essentially a skybox with dynamic camera. Renders the same way. That much, I know.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »

So why does this glitch so much but skyboxes don't?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »

Tormentor667 wrote:How hard will it be to make this also work in hardware GZDOOM?

Not much. It's just waiting to be merged.
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand

Re: Wall portals

Post by edward850 »

Graf Zahl wrote:So why does this glitch so much but skyboxes don't?
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.
Last edited by edward850 on Mon Jan 25, 2016 2:40 am, edited 2 times in total.
User avatar
Tormentor667
Posts: 13547
Joined: Wed Jul 16, 2003 3:52 am

Re: Wall portals

Post by Tormentor667 »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »

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.
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.
(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.
User avatar
hfc2x
Posts: 646
Joined: Mon Aug 17, 2009 11:37 am
Location: Chule

Re: Wall portals

Post by hfc2x »

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.
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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »

Didn't I say this?
User avatar
Tormentor667
Posts: 13547
Joined: Wed Jul 16, 2003 3:52 am

Re: Wall portals

Post by Tormentor667 »

Tormentor667 wrote:For ZDoom in general: How far is this from being merged?
Sorry for asking again, I am just curious
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Wall portals

Post by Major Cooke »

Graf Zahl wrote:Didn't I say this?
He actually asked if zzyzx tried it under the notion that it hadn't worked.
Tormentor667 wrote:Sorry for asking again, I am just curious
From looking over the past page, sounds like it's (almost) ready.
User avatar
Tormentor667
Posts: 13547
Joined: Wed Jul 16, 2003 3:52 am

Re: Wall portals

Post by Tormentor667 »

This would come at the perfectly right time. Is this working also fluid through flats and not only walls?
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine

Re: Wall portals

Post by ZZYZX »

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.
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.
It's in fact three simple PointOnLineSide checks:
Image
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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Wall portals

Post by Graf Zahl »

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.
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Wall portals

Post by Major Cooke »

Another thing to consider:
Image

(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.
User avatar
Tormentor667
Posts: 13547
Joined: Wed Jul 16, 2003 3:52 am

Re: Wall portals

Post by Tormentor667 »

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 :P

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

Return to “Closed Feature Suggestions [GZDoom]”