The idea is to create wall portals which will act like floor/ceiling portals.
This requires line special:
e.g. Line_SetPortal(Source LineID, Target LineID, Transclucency ammount)
It can be done like this:
1) special is set to the first linedef: Line_SetPortal(1, 2, 64)
2) this special also is set to another linedef: Line_SetPortal(2, 1, 64)
Thing movements through portals are not allowed.
Skyboxes, texture cameras etc are not solutions of this problem.
Wall portals
Moderator: Graf Zahl
-
- Posts: 38
- Joined: Wed Jul 16, 2008 18:42
- Location: Russia, Saint-Petersburg
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact:
- Rachael
- Developer
- Posts: 3645
- Joined: Sat May 13, 2006 10:30
Wall portals are actually fairly doable, but the process can be a little complicated. I lack any understanding of C++ coding in this instance, but the basic idea is still there. What you really need is the ability to conditionally render certain areas, but NOT others.
First, your BSP nodes need to be set up correctly, that anything behind the portal (on the viewer's side) is not rendered. Failing that, you may need to simply block it out. I think that's the hardest part. The game may even have to split sectors (internally) in order for it to work. You can't always count on a mapper splitting their sectors correctly.
Secondly, on the portal side (where the viewer is not), anything behind the portal (in your perspective, in front of it) has to be blocked out, so that walls that appear will not show up.
Thirdly, you would simply render the portal side first as if the player used an IDCLIP cheat outside the wall, player's position being relative to the portal's position; it will look funky at first but after the addition of the viewer's side, it will look alright.
Fourthly, you would render the viewer's side, and if everything goes according to plan, it looks just as if the portal was directly connected to the wall.
Any initial implementation of this would be slower than hell because of all the processing behind it, but with a few optimizations it will eventually look right and be playable.
Another option, instead of blocking out sectors, take a snapshot of the entire screen buffer after rendering portal side, but before viewer side (this is where things get to be SLOW!!!), and then after viewer side is drawn, take the portal side snapshot and force it back right onto the wall. You'd still have to block out everything behind the portal, though, but this makes things a lot easier.
First, your BSP nodes need to be set up correctly, that anything behind the portal (on the viewer's side) is not rendered. Failing that, you may need to simply block it out. I think that's the hardest part. The game may even have to split sectors (internally) in order for it to work. You can't always count on a mapper splitting their sectors correctly.
Secondly, on the portal side (where the viewer is not), anything behind the portal (in your perspective, in front of it) has to be blocked out, so that walls that appear will not show up.
Thirdly, you would simply render the portal side first as if the player used an IDCLIP cheat outside the wall, player's position being relative to the portal's position; it will look funky at first but after the addition of the viewer's side, it will look alright.
Fourthly, you would render the viewer's side, and if everything goes according to plan, it looks just as if the portal was directly connected to the wall.
Any initial implementation of this would be slower than hell because of all the processing behind it, but with a few optimizations it will eventually look right and be playable.
Another option, instead of blocking out sectors, take a snapshot of the entire screen buffer after rendering portal side, but before viewer side (this is where things get to be SLOW!!!), and then after viewer side is drawn, take the portal side snapshot and force it back right onto the wall. You'd still have to block out everything behind the portal, though, but this makes things a lot easier.
- Tormentor667
- Stronghold Team
- Posts: 3555
- Joined: Sun Nov 13, 2005 23:15
- Location: Germany
- Contact:
- Graf Zahl
- GZDoom Developer
- Posts: 7148
- Joined: Wed Jul 20, 2005 9:48
- Location: Germany
- Contact: