Page 1 of 1

Player sprite seen briefly when crossing static portals

PostPosted: Thu Feb 07, 2019 5:46 pm
by gramps
When passing through a static portal, your player sprite is sometimes visible for a split second, right in front of you (maybe for just a single frame). This doesn't happen consistently, so you may need to run through portals many times before seeing it.

First noticed this happening some time after the recent rollback. It also happens in the new level refactor builds. Haven't ever noticed it prior to that.

Have only observed this in the OpenGL renderer. Checked for it in the other renderers, but couldn't get it to happen there. It's possible it's not limited to the GL renderer, though, since it can't be reproduced consistently.

I can provide a test map if needed, but any map with some static portals to run through should work.

Re: Player sprite seen briefly when passing though a portal

PostPosted: Thu Feb 07, 2019 5:48 pm
by Enjay
That is something that has been noticed before (some years ago in fact). It certainly was addressed before, so I wonder if it has become more obvious again?

Re: Player sprite seen briefly when passing though a portal

PostPosted: Thu Feb 07, 2019 6:11 pm
by Rachael
This is not a solvable issue due to the way interpolation and player prediction works. The problem can be mitigated by disabling the player prediction in the network options menu but that makes it play different.

Re: Player sprite seen briefly when passing though a portal

PostPosted: Thu Feb 07, 2019 6:23 pm
by Enjay
I've just tried a few maps that use static portals - running back and forth through them - and not seen the player sprite once (including in some maps that used to cause the problem back when it was first reported). I'm not disputing the report, but from what I can see, most of the time the issues is not visible and I guess whatever was done to address this is still mostly doing what it is intended to do.

Re: Player sprite seen briefly when passing though a portal

PostPosted: Thu Feb 07, 2019 6:57 pm
by gramps
It seems like it won't happen for a while, and then it'll happen almost every time for a while, and sort of alternate like that, when pretty much constantly running through portals. Maybe it has something to do with temporary drops in fps, not sure. If this issue has been present the whole time, maybe I'm just now noticing it as the map I'm working on bogs performance down a bit more as it gets more detailed.

Anyway, it's not a huge issue. It's gone so fast that I wasn't even sure it was a player sprite until I happened to get a good look at it recently. Just thought I should report it now that I'm actually sure of what I'm seeing.

Re: Player sprite seen briefly when passing through a portal

PostPosted: Thu Feb 07, 2019 10:51 pm
by Rachael
You can see it very easily if you tank your FPS. Try setting vid_scalefactor to 2, and enable SSAO, and set multisampling to 32x. Unless you have a monster of a GPU, your FPS should now be low enough to see the effect.

Re: Player sprite seen briefly when passing through a portal

PostPosted: Thu Feb 07, 2019 11:49 pm
by gramps
Hmm, here's a thought. There's a `Viewpoint.showviewer` that looks like it's responsible for deciding whether to render the player sprite. Without really knowing anything about the code, it seems that this could possibly just be turned off for static portals, since it doesn't seem like there's any possible configuration with static portals *alone* where the viewer should be visible. But I'm not sure how it's all supposed to work when other portals/mirrors come into play.

Re: Player sprite seen briefly when passing through a portal

PostPosted: Fri Feb 08, 2019 12:05 am
by Rachael
That sounds pretty hacky. I don't know how Graf feels about that, but personally I am a bit dubious about it. Ideas like that make the code unreadable after a while.

Re: Player sprite seen briefly when passing through a portal

PostPosted: Fri Feb 08, 2019 12:18 am
by gramps
Yeah, this may be the wrong place to do it, I'm not sure (really have zero familiarity with this code). But it still might make sense to have the viewer never be visible as a result of a static portal one way or another, since there doesn't seem to be a legitimate situation where that should actually happen, due to the way static portals work.

Re: Player sprite seen briefly when crossing static portals

PostPosted: Fri Feb 08, 2019 2:22 am
by Graf Zahl
There is no good solution, unfortunately. The main reason for that is that thanks to arbitrary portals any camera may show the player and adding some global switch for the sprite will always have some negative side effects.

The entire player interpolation code really needs to be tossed out and rewritten - unfortunately it's one of the more obtuse legacies of ZDoom.

Re: Player sprite seen briefly when crossing static portals

PostPosted: Tue Mar 26, 2019 5:30 pm
by Darkcrafter
What's more interesting is that effect disappears with a better graphics card that provides a smooth framerate. The old 2007 card (ATI Radeon HD2400 PRO) wasn't only showing a player but also had a strange crossfade where a portal passage could be seen.