Other Portals can't be viewed through a plane portal

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Other Portals can't be viewed through a plane portal

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

by dpJudas » Sat May 13, 2017 1: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 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.

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

by Wuerfel_21 » Sat May 13, 2017 12:51 pm

Hmm, a Skybox can be viewed through a plane portal...

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

by Rachael » Fri May 12, 2017 12:40 pm

You must've missed where I said redoing them from scratch, after. :P

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

by Graf Zahl » Fri May 12, 2017 12:36 pm

And used a lot, so cutting them out is not an option.

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

by Rachael » Fri May 12, 2017 12: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.

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

by dpJudas » Fri May 12, 2017 10: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.

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

by Graf Zahl » Fri May 12, 2017 10: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.

Other Portals can't be viewed through a plane portal

by Wuerfel_21 » Fri May 12, 2017 10: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 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

Top