Page 1 of 1

Warp on Portals

PostPosted: Thu Sep 27, 2018 1:10 am
by Pixel Eater
It would be awesome if we could apply either of the warp effects to a portal's visuals, or hell- why not the wipe effect? :lol:
And if it's even possible, I'm also wondering whether by using a generic mid-texture we could designate which portals to enable (like using F_SKY)?

Re: Warp on Portals

PostPosted: Thu Sep 27, 2018 5:14 am
by Graf Zahl
Portals do not work like that. They get rendered directly into the scene. What's possible is to run some postprocessing over its pixels but not alter its shape or move contents around. For that you need an actual texture which does not exist.

Re: Warp on Portals

PostPosted: Thu Sep 27, 2018 6:38 am
by Pixel Eater
Oh well, that's a shame. It would have looked nifty if possible!

I'm guessing the post-processing that's doable is limited to tint effects then?

Re: Warp on Portals

PostPosted: Thu Sep 27, 2018 6:47 am
by Graf Zahl
Effectively yes. Currently it's only doing SSAO but in a way that's also just a selective tint.

Re: Warp on Portals

PostPosted: Thu Sep 27, 2018 12:39 pm
by Apeirogon
What about "camera texture" hack? Place camera near both portal sides and then draw texture from it to portal line.
Or I think about wrong portal type?

Re: Warp on Portals

PostPosted: Thu Sep 27, 2018 12:51 pm
by Graf Zahl
That won't look like a portal.

Re: Warp on Portals

PostPosted: Fri Sep 28, 2018 11:24 am
by Apeirogon
Why? I miss something?

Re: Warp on Portals

PostPosted: Fri Sep 28, 2018 12:24 pm
by Gez
To make a camera texture that would be somewhat convincing as a portal, you'd need to move the camera to match the movements of the player (both translations and rotations). Otherwise, with a static camera, it'll look like a TV screen (which it effectively is inside the game world) rather than a window.

And if you do move the camera along with the player, then it'll only work in single player.

Re: Warp on Portals

PostPosted: Fri Sep 28, 2018 1:45 pm
by Rachael
Not only that, but you would also have to properly project to a flat surface, regardless of the player's angle. That pretty much means the entire effect has to exist on a sprite or the effect is dead.

Re: Warp on Portals

PostPosted: Mon Oct 08, 2018 9:28 am
by Apeirogon
Gez wrote:multiplayer

Oh yes I see... And gzdoom cant draw different textures for different players, right?!

Rachael wrote:Not only that, but you would also have to properly project to a flat surface, regardless of the player's angle. That pretty much means the entire effect has to exist on a sprite or the effect is dead.

Why? Yes, with default camera interpolations portal, as rift in level, would be visible. And the the goal is create warp effect for portal texture. Soo...

Re: Warp on Portals

PostPosted: Mon Oct 08, 2018 10:24 am
by Gez
You could try a different approach: in front of your portal, put a translucent, solid-colored texture outside of the game's color palette. So that everything seen through the portal is chroma-keyed with that color. Then a post-process filter can warp the chroma-keyed area and also change the hue to offset the coloration and hopefully restore the colors to something more natural.

Re: Warp on Portals

PostPosted: Mon Oct 08, 2018 6:44 pm
by Pixel Eater
Chroma keying?! Seriously Gez, you know that's not my cup of tea! :P

PortalWorp.pk3
(5.3 KiB) Downloaded 26 times

Spoiler:

Re: Warp on Portals

PostPosted: Tue Oct 09, 2018 9:05 am
by Apeirogon
And what you have in mind?

Im not sure that drawed on screen "photo" of some place in the game world would be the same as if you look at it with you own "eyes".
I mean, gzdoom draw scene with effect similar with real world spherical aberration effect like
http://foto-like.ru/wp-content/uploads/sfer.jpg
in vertical, and a little bit in horizontal, dimensions.
Just carefully look around in any map to see this. With low res doom textures its not very noticeable, but with pbr materials/models/etc. you will see it in few seconds.

Re: Warp on Portals

PostPosted: Tue Oct 09, 2018 11:36 am
by Gez
Pixel Eater wrote:Chroma keying?! Seriously Gez, you know that's not my cup of tea! :P

So a less extreme warping, perhaps just some sort of shimmering effect, and with a fade to black from the center so that the black borders appear natural, and making sure there are no additive translucency effects going on behind the portal view, and it would work okay. :wink:

Re: Warp on Portals

PostPosted: Tue Oct 09, 2018 3:22 pm
by Pixel Eater
@Apeirogon: I was thinking it could be possible to attach a dummy actor to each corner of the portal and then use those coordinates for the shader. But it was more of an academic thought than an 'I must go to there' moment. I'll stick with the chroma key for now, it might even make it's way into my Spooktober map :twisted:

@Gez: I definitely want to scale the effect into smaller tiles for a shimmery effect but I'm not familiar with how the warp code works, I just copied and pasted it from gzdoom.pk3. I also didn't think of fading it- and I might have a way how now that you mention it :)