Other Portals can't be viewed through a plane portal

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Wuerfel_21
Posts: 34
Joined: Mon May 01, 2017 1:33 pm

Other Portals can't be viewed through a plane portal

Post by Wuerfel_21 »

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

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

Post by Graf Zahl »

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.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

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

Post by dpJudas »

Both line and sector portals are implemented in the poly renderer, but they have some culling issues that causes them to HOM a lot.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

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

Post by Rachael »

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

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

Post by Graf Zahl »

And used a lot, so cutting them out is not an option.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

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

Post by Rachael »

You must've missed where I said redoing them from scratch, after. :P
Wuerfel_21
Posts: 34
Joined: Mon May 01, 2017 1:33 pm

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

Post by Wuerfel_21 »

Hmm, a Skybox can be viewed through a plane portal...
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

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

Post by dpJudas »

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 all

			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 all

			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 all

		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.
Post Reply

Return to “Closed Bugs [GZDoom]”