Fake Portal Effect

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
JonayaRiley
Posts: 293
Joined: Thu Aug 07, 2008 11:48 pm
Graphics Processor: nVidia with Vulkan support
Location: Austin, TX
Contact:

Fake Portal Effect

Post by JonayaRiley »

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 160 times
User avatar
Remmirath
Posts: 2561
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

Re: Fake Portal Effect

Post by Remmirath »

Neat! Just like Serious Sam portals. :D
User avatar
Isle
Posts: 687
Joined: Fri Nov 21, 2003 1:30 am
Location: Arizona, USA

Re: Fake Portal Effect

Post by Isle »

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
JonayaRiley
Posts: 293
Joined: Thu Aug 07, 2008 11:48 pm
Graphics Processor: nVidia with Vulkan support
Location: Austin, TX
Contact:

Re: Fake Portal Effect

Post by JonayaRiley »

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 124 times
User avatar
JonayaRiley
Posts: 293
Joined: Thu Aug 07, 2008 11:48 pm
Graphics Processor: nVidia with Vulkan support
Location: Austin, TX
Contact:

Re: Fake Portal Effect

Post by JonayaRiley »

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
Isle
Posts: 687
Joined: Fri Nov 21, 2003 1:30 am
Location: Arizona, USA

Re: Fake Portal Effect

Post by Isle »

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
JonayaRiley
Posts: 293
Joined: Thu Aug 07, 2008 11:48 pm
Graphics Processor: nVidia with Vulkan support
Location: Austin, TX
Contact:

Re: Fake Portal Effect

Post by JonayaRiley »

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
Spleen
Posts: 497
Joined: Fri Nov 28, 2008 7:07 pm

Re: Fake Portal Effect

Post by Spleen »

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
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: Fake Portal Effect

Post by Tormentor667 »

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 :(
Locked

Return to “Editing (Archive)”