Eternity-like portals?

Moderator: Graf Zahl

User avatar
Janitor
Persecution Complex
Posts: 123
Joined: Sun Jul 08, 2007 17:16
Location: Not in Kansas anymore

Eternity-like portals?

Post by Janitor »

I have a feeling this is going to be an 'ask randy' or 'quit asking graf/randy' question, but is there any chance of implementing some more extensive portals? The ability to stack more than 3 sectors would be useful. I understand that GZDoom does do 3D floors, but portals would allow a lot more flexibility and interesting architecture. Also, 'horizontal' portals (imagine the example of the "infinite hallway") could be used for some interesting effects. Are these possible?
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Eternity-like portals?

Post by Graf Zahl »

Eternity's portal code relies heavily on how the software renderer performs visibility clipping. Doing that with a hardware renderer will massively cost performance and so far I haven't found a solution for it. I don't think these can be solved with the current rendering logic.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Eternity-like portals?

Post by Graf Zahl »

The start is done: Eternity's portal definition linedefs are in.
User avatar
Nash
Developer
Developer
Posts: 1226
Joined: Sun Sep 25, 2005 1:49
Location: Kuala Lumpur, Malaysia
Contact:

Re: Eternity-like portals?

Post by Nash »

So does this mean we are eventually getting Eternity portals, functionality/interactivity and all? Or is it purely visual? Lastly, will it be backported to software ZDoom?
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Eternity-like portals?

Post by Gez »

From my understanding of things:
Nash wrote:So does this mean we are eventually getting Eternity portals
No. Replace "are" by "might be" and you'd get a "yes".
Nash wrote:functionality/interactivity and all? Or is it purely visual?
For now, it's just a different (and usually better) way to do what was done before with stack points.

To get the full level of Eternity's linked portals, then messing with the physics code would also be needed. Further, Eternity also has wall portals, as shown in that youtube vid. Here we're still just with floor/ceiling portals.
Nash wrote: Lastly, will it be backported to software ZDoom?
It's already there.
Graf Zahl wrote: And for those who are interested, Eternity's line types translate as follows:

Code: Select all

298 = 0,		Sector_SetPortal(tag, 0, 1, 0, 0)
299 = 0,		Sector_SetPortal(tag, 0, 0, 0, 0)
295 = 0,		Sector_SetPortal(tag, 0, 1, 1, 0)
296 = 0,		Sector_SetPortal(tag, 0, 0, 1, 0)
Those line types correspond to those listed here, not these ones. That is to say, the portals that are just like ZDoom's portals, not the linked portals everybody's thinking about.
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Eternity-like portals?

Post by Gez »

There are a few portal types in Eternity that I think wouldn't be too hard to implement in ZDoom.
Plane portals:
Fixed plane portals (as the name implies) render a single, fixed plane into the portal window. The plane is always rendered a the same height and texture offset even when the camera changes its position.

Line specials:

283 Apply fixed plane portal to the ceilings of tagged sectors
284 Apply fixed plane portal to the floors of tagged sectors
285 Apply fixed plane portal to the floors and ceilings of tagged sectors

The front side sector of the special line is used to generate the plane. The ceiling texture, sector light, and ceiling texture scrolling are all used as attributes for the rendered fixed plane. The absolute height of the ceiling is used as the height of the plane. That is, if the special line front sector has a ceiling height of 64, the plane will always render at 64 units above the camera height. If the ceiling height is 128, the plane will always render at 128 units above the camera height, and so on.
Basically, it's in a way akin to generating on the fly a sector skybox with line horizons.

Horizon portals:
Horizon portals display two planes which appear to go on forever until they meet in the middle (horizon). The plane coordinates are not fixed, and will appear to move with the camera. This can be used to achieve the illusion that water or grass goes off far into the distance without having to make overly large sectors.

Line specials:

286 Apply horizon portal to the ceilings of tagged sectors
287 Apply horizon portal to the floors of tagged sectors
288 Apply horizon portal to the floors and ceilings of tagged sectors

Like the fixed plane portals, the front sector of the special line is used. The top plane uses the front sector ceiling (height, texture, scrolling, light) as its model, and the bottom plane uses the front sector floor (height, texture, scrolling, light) as its model.
A variant of the former. There is code for horizon in ZDoom already, though it's for applying it to a line, not to a plane. The only difference between plane portals and horizon portals is whether the portal camera remains always at the same height or not.

Skybox portal:
Skybox portals draw another part of the map into the portal window. The scene in the portal window will use the angle from the player camera, but will render the scene from the location of the skybox camera. This helps create the illusion that the contents of the skybox actually surround the map and are much larger in size than they really are.

Line specials:

290 Apply skybox portals to the ceilings of tagged sectors
291 Apply skybox portals to the floors of tagged sectors
292 Apply skybox portals to the floors and ceilings of tagged sectors

The front sector of the special line becomes the "skybox sector". This is not the only sector that gets rendered, but this sector is where Eternity will look for the skybox camera object which will be the point the skybox is rendered from.
Basically, what this means is using a linedef instead of a skypicker. Took me ten minutes to implement this as another portal type for Sector_SetPortal.

Anchored portals are already there of course. Remains linked portals, and EE's special 289. Special 289 is the only effect in available Eternity mods (notably Ogro Power Facility) that cannot be xlated adequately at the moment.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Eternity-like portals?

Post by Graf Zahl »

No, they wouldn't be hard to implement - but I somehow question most of their usefulness.

But keep in mind that for ZDoom's software renderer Randy has to code it and we all know how he treats the feature suggestions forum. I'll add them in GZDoom once they get used in a map with which I can test them.

Concerning skyboxes, what did you do in 10 minutes? Care to share it?
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Eternity-like portals?

Post by Gez »

Graf Zahl wrote:Care to share it?
Not in its present state. I need to get rid of a not-so-reliable hack first. :wink:
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Eternity-like portals?

Post by Gez »

Here it is now, rewritten in rather clean way. It required a new native actor type, but that's by far preferable to the horrible hacks, quick but very dirty, I used at first. You don't want to know about them, trust me. :P

Included is also a testing level. You'll notice the patch also fixes a few minor bugs in the support of other translated EE features.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Eternity-like portals?

Post by Graf Zahl »

Looks interesting. Just one question: None of this involves changing GL code. Can I assume that this is working in ZDoom, too?
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Eternity-like portals?

Post by Gez »

Yeah, it simply reuses the existing skybox code. It's not a new feature.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Eternity-like portals?

Post by Graf Zahl »

There's one thing I do not fully understand. You are messing around with the skybox viewpoint's tid which looks like it's not necessary. Why are you doing this. Wouldn't it make more sense to keep the tid free for other uses?
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Eternity-like portals?

Post by Gez »

You're right, it's not needed. Updated patch.
Attachments
gzdee.zip
(15.23 KiB) Downloaded 133 times
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Eternity-like portals?

Post by Graf Zahl »

And this?

Code: Select all

+	if (tid == 0 && Sector != NULL)
Is there a reason that this actor only initializes if it does not have a tid?
User avatar
Gez
Developer
Developer
Posts: 1399
Joined: Mon Oct 22, 2007 16:47

Re: Eternity-like portals?

Post by Gez »

Oh right, now I remember why it sets the tid originally. Super::BeginPlay() will make it the default skybox if the tid is zero. I don't have an area of standard sky in my test map.

The idea was that it would behave just like a normal SkyViewpoint unless the tid is zero.
Locked

Return to “Closed Feature Suggestions”