Fake Portal Effect

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Fake Portal Effect

Postby JonnyFive » Fri Nov 14, 2008 12:41 pm

Playing around with some proof-of-concept stuff for my next project, I decided to mess around with a little fake portal effect using skyboxes and silent teleporters. I was actually able to get something pretty nice looking, albeit somewhat of a pain in the ass to implement.

The trick is a script that moves the skybox viewpoint around with the player. In this case, it simply takes the x, y, and z coordinates and adds a bit to y (the sectors are lined up on the x-axis) and z to give the proper depth effect when looking through the portal.

The only limitation is that the portal will display HOM or strange artifacts if the player's position would cause the translated values of the skybox viewer to be out of the map geometry (or inside the wrong piece of map geometry), so if you want to use this effect you'll have to set it up with care. Take a look at how I did the effect and you should get an idea of what the limitations are.

I'm sure I could do a more robust version of this with some generic ACS code along with some map spots to get the x,y, and z shift automatically. That way a bunch of portals could be set up using an array in ACS containing the TIDs of the marker spots and associated skybox things, kind of like how weatherFX tracks the weather zone markers and conditions.

Anyway, feel free to mess around with it. I have no idea if this has been done before, but I figured it'd be fun for some people to play with.
Attachments
portaltest.wad
Portal effect. Whee!
(42.18 KiB) Downloaded 101 times
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: Fake Portal Effect

Postby Remmirath » Fri Nov 14, 2008 1:16 pm

Neat! Just like Serious Sam portals. :D
User avatar
Remmirath
And Pierce...Well, who gives a fuck about Pierce?
 
Joined: 23 Dec 2007
Location: Here

Re: Fake Portal Effect

Postby Isle » Fri Nov 14, 2008 2:53 pm

heh, i've allready done this in more than a few test wads.
i also used something like it for the chopper in action doom 2.
User avatar
Isle
WadAuthor 4 L1F3
 
Joined: 21 Nov 2003
Location: Arizona, USA

Re: Fake Portal Effect

Postby JonnyFive » Fri Nov 14, 2008 2:56 pm

Here's a more flexible version, which also shows the main limitations of the effect. First off, currently both portals must be parallel to each other. Also, because the viewpoint is free to move around in the destination sector, you have to be careful about what's in the area behind the destination portal or you might have the portal view clipping through sprites and such, which looks pretty weird.
Attachments
portaltest_v2.wad
(53.86 KiB) Downloaded 81 times
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: Fake Portal Effect

Postby JonnyFive » Fri Nov 14, 2008 2:58 pm

Isle wrote:heh, i've allready done this in more than a few test wads.
i also used something like it for the chopper in action doom 2.


I figured someone else would've thought of it. :)

Ironically, I was also working on creating a chopper when I decided to mess around with this.
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: Fake Portal Effect

Postby Isle » Fri Nov 14, 2008 3:06 pm

the main problem with this type of effect is theres no way to get the actual view height of the player. so the portal view dosen't bob along with the player's view.
User avatar
Isle
WadAuthor 4 L1F3
 
Joined: 21 Nov 2003
Location: Arizona, USA

Re: Fake Portal Effect

Postby JonnyFive » Fri Nov 14, 2008 3:11 pm

Isle wrote:the main problem with this type of effect is theres no way to get the actual view height of the player. so the portal view dosen't bob along with the player's view.


Yeah, also it doesn't move when they crouch, which is pretty weird looking.

Also, since the view isn't actually rendering from the destination spot, what can be done with it is very restricted.
User avatar
JonnyFive
I will now leave for no raisin!
 
Joined: 08 Aug 2008
Location: New York

Re: Fake Portal Effect

Postby Spleen » Thu Dec 11, 2008 2:01 am

This is very neat! I'm sure it is possible to add crouching support through scripts if needed, if with nothing else then with the input-getting function.

But there's only one viewpoint for everyone, right? So I'm guessing this wouldn't work in multiplayer..

A less hacky way is to do this with cameras, although I'm sure it will not look as good. If the ZDoom engine can draw mirrors, why can't it do a linedef replace? Say, there was a linedef to be rendered... instead of going through that linedef to whatever's behind it, it could skip to an entirely different linedef specified by an action special. Or are stacked sectors used for this kind of thing (perhaps there might be a way to make a portal effect with stacked sectors?)? Sorry for the bump, but I registered after this post was made, and I find this portal effect very interesting. And stacked sectors confusing. =P
User avatar
Spleen
I'm drunnk1 hehahohee111!!!one
 
Joined: 28 Nov 2008

Re: Fake Portal Effect

Postby Tormentor667 » Thu Dec 11, 2008 2:14 am

Someone in the old ZDoom forums already did something similar (yeah, the good old notgod times ;)) but the problem with this is the fact that it won't work in multiplayer games and therefore is by far too limited :(
User avatar
Tormentor667
 
Joined: 16 Jul 2003
Location: Germany


Return to Editing

Who is online

Users browsing this forum: Ahrefs [Bot], Galaxy_Stranger, Sgt. Shivers and 2 guests