Other Portals can't be viewed through a plane portal

Moderator: Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Other Portals can't be viewed through a plane portal

Postby Wuerfel_21 » Fri May 12, 2017 11:25 am

Aaaand another one of those:

When looking through a plane portal, all portals that would otherwise be visible display either HOM, a distorted flat or (if it is a plane portal) its texture.
Again, find ye WAD at https://forum.zdoom.org/viewtopic.php?f=57&t=56393

I understand there are limits to what can be done in the SW renderer, but to me, roughly knowing how plane portals are implemented (i.e. glorified skyboxes/camtexes), this seems like something that could be fixed with medium effort.

Ironically, the opposite applies to softpoly: It does the stacked sectors like a champ, but HATES line portals o.O

Again, all tested on GZDoom 3.0.1
Wuerfel_21
 
Joined: 01 May 2017
Discord: Wuerfel_21#4233

Re: Other Portals can't be viewed through a plane portal

Postby Graf Zahl » Fri May 12, 2017 11:46 am

Fixing plane portals in the software renderer is not trivial. They have essentially been an abandoned feature for the entire time of their existence. Officially any advanced use is not considered available for software rendering.

No idea what's the status of line portals in the poly renderer. I would have thought they'd work there, so for this I'll wait for an explanation what the actual state is.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Other Portals can't be viewed through a plane portal

Postby dpJudas » Fri May 12, 2017 11:57 am

Both line and sector portals are implemented in the poly renderer, but they have some culling issues that causes them to HOM a lot.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Other Portals can't be viewed through a plane portal

Postby Rachael » Fri May 12, 2017 1:05 pm

Graf Zahl wrote:Fixing plane portals in the software renderer is not trivial. They have essentially been an abandoned feature for the entire time of their existence. Officially any advanced use is not considered available for software rendering.

This is exactly correct. Line portals are okay, but plane portals are in a state right now where it's more worth cutting them out completely and redoing them from scratch. But I don't think anyone has time to do that. >_< After they were put in they were pretty much forgotten about.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: Other Portals can't be viewed through a plane portal

Postby Graf Zahl » Fri May 12, 2017 1:36 pm

And used a lot, so cutting them out is not an option.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Other Portals can't be viewed through a plane portal

Postby Rachael » Fri May 12, 2017 1:40 pm

You must've missed where I said redoing them from scratch, after. :P
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: Other Portals can't be viewed through a plane portal

Postby Wuerfel_21 » Sat May 13, 2017 1:51 pm

Hmm, a Skybox can be viewed through a plane portal...
Wuerfel_21
 
Joined: 01 May 2017
Discord: Wuerfel_21#4233

Re: Other Portals can't be viewed through a plane portal

Postby dpJudas » Sat May 13, 2017 2:41 pm

Technically, the problem with the software renderer portal implementation is that it abused the plane list for storing the silhouette for sector portals. When it renders plane portals it does this:

Code: Select allExpand view
         Thread->OpaquePass->RenderScene();
         Thread->Clip3D->ResetClip(); // reset clips (floor/ceiling)
         planes->Render();

That is then followed by an additional step where it draws the sprites:

Code: Select allExpand view
         Thread->TranslucentPass->Render();
         visplaneStack.Pop(pl);
         if (pl->Alpha > 0 && pl->picnum != skyflatnum)
            pl->Render(Thread, pl->Alpha, pl->Additive, true);


The line portals, on the other hand does this:

Code: Select allExpand view
      Thread->OpaquePass->RenderScene();
      Thread->Clip3D->ResetClip(); // reset clips (floor/ceiling)
      Thread->PlaneList->Render();
      RenderPlanePortals();
      unsigned int portalsAtEnd = WallPortals.Size();
      for (; portalsAtStart < portalsAtEnd; portalsAtStart++)
      {
         RenderLinePortal(WallPortals[portalsAtStart], depth + 1);
      }
      Thread->TranslucentPass->Render();     //      this is required since with portals there often will be cases when more than


What is worth pointing about this code it that:

1) Sector recursion does not render portal lines, while line recursion does render the portal sectors.
2) Copy and paste of the Doom scene rendering steps (draw walls, draw planes, draw portals, draw translucent). Three code variants of this exists in the code now (original, line and sector).
3) All portal handling is done by pushing objects at the end of already existing lists, making it super important to know which range of objects belong to each portal. The tracking of this is, naturally, spaghetti'ed over the rest of the renderer.

You will not see me even attempt at touching this code unless I have a fully functioning softpoly portal implementation. This is because the only way I can fix the above issues is by merging #2 listed above into one draw scene function again, and that requires a 110% complete understanding of what it takes to draw the portals.

Reporting further which special cases actually works in the current software renderer will unfortunately not help getting it fixed. Thanks for the feedback, though.
dpJudas
 
 
 
Joined: 28 May 2016


Return to Software Renderer Bugs

Who is online

Users browsing this forum: No registered users and 1 guest