Pixels of the weapon sprite being distorted during movement

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!
User avatar
Sinael
Posts: 239
Joined: Tue Oct 18, 2011 8:57 am

Pixels of the weapon sprite being distorted during movement

Post by Sinael »

in GZDoom with texture filtering turned off, whenever a weapon sprite moves on screen its pixels become inconsistent in size, and instead constantly resize and realign, as if sprite image is being resampled differently every frame. This results in "wobbliness", "distortion waves" and other nasty effects. They are generally miniscule, but are far more noticable on larger sprites, however when you do notice it, you can not "unnotice it" again, kinda like "you are now aware you are breathing" thing (sorry by the way).

It is most noticeable in high resolutions (like 1600x900), but same effect happens at lower resolutions as well. Also much less pronounced in software, the slight "distortion wave" can still be seen.

I'm not sure how to explain it better, so here's some comparison videos. Videos have been taken from 1600x900 footage, cropped to the gun (BFG in this case) then doubled in resolution with integer scaling to make the matter more clearly visible.

This is how it looks in glBoom+ (no distortions): https://my.mixtape.moe/yljwuu.webm

This is GZDoom software mode (distortions most visible in the horizontal lines): https://my.mixtape.moe/bgirpo.webm

This is GZDoom OpenGL mode (distortions allover the place) https://my.mixtape.moe/spgehb.webm

This happens at any resolution.
_mental_
 
 
Posts: 3771
Joined: Sun Aug 07, 2011 4:32 am

Re: Pixels of the weapon sprite being distorted during movem

Post by _mental_ »

Links to videos are broken, got '404 Fire not found!' on all of them.
User avatar
wildweasel
Moderator Team Lead
Posts: 21373
Joined: Tue Jul 15, 2003 7:33 pm

Re: Pixels of the weapon sprite being distorted during movem

Post by wildweasel »

The links seem to work fine for me.
User avatar
phantombeta
Posts: 1982
Joined: Thu May 02, 2013 1:27 am
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Pixels of the weapon sprite being distorted during movem

Post by phantombeta »

Not a bug as far as I know. This is an unfortunate artifact of non-integer nearest-neighbour scaling and movement.
User avatar
Enjay
 
 
Posts: 26403
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Pixels of the weapon sprite being distorted during movem

Post by Enjay »

_mental_ wrote:Links to videos are broken, got '404 Fire not found!' on all of them.
It could be because the website security certificate is expired. Firefox blocks it with a message saying as much.
User avatar
sinisterseed
Posts: 1275
Joined: Tue Nov 05, 2019 6:48 am
Github ID: sinisterseed
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Pixels of the weapon sprite being distorted during movem

Post by sinisterseed »

phantombeta wrote:Not a bug as far as I know. This is an unfortunate artifact of non-integer nearest-neighbour scaling and movement.
Bumping this up since I wanted to post about this as well, but I remembered this topic exists already.

I've recently noticed the same issue (playing in 1080p, though I don't think it actually matters), and indeed, it is one of those things that you can't unsee once you've noticed them. I'm no programmer, so in this case, could you explain why this would be the case? GZDoom is virtually the only port I'm using that exhibits this behavior - Choco, Crispy, PrBoom, Eternity, none of them appear to suffer from this.
User avatar
phantombeta
Posts: 1982
Joined: Thu May 02, 2013 1:27 am
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Pixels of the weapon sprite being distorted during movem

Post by phantombeta »

lowskill. wrote:I've recently noticed the same issue (playing in 1080p, though I don't think it actually matters), and indeed, it is one of those things that you can't unsee once you've noticed them. I'm no programmer, so in this case, could you explain why this would be the case? GZDoom is virtually the only port I'm using that exhibits this behavior - Choco, Crispy, PrBoom, Eternity, none of them appear to suffer from this.
As far as I know, those are all software-rendered ports. Vanilla Doom's software renderer can't really exhibit this behaviour as far as I know. GZDoom draws screen elements (the statusbar, weapon, menus, etc.) with the selected backend, and it does nearest neighbour resizing at non-integer scales instead of trying to force it to integer scales.
GZDoom also has interpolation for the weapon bobbing (and weapon/PSprite offsets) with non-integer coordinates, which also causes this issue.
User avatar
sinisterseed
Posts: 1275
Joined: Tue Nov 05, 2019 6:48 am
Github ID: sinisterseed
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Pixels of the weapon sprite being distorted during movem

Post by sinisterseed »

phantombeta wrote:
lowskill. wrote:I've recently noticed the same issue (playing in 1080p, though I don't think it actually matters), and indeed, it is one of those things that you can't unsee once you've noticed them. I'm no programmer, so in this case, could you explain why this would be the case? GZDoom is virtually the only port I'm using that exhibits this behavior - Choco, Crispy, PrBoom, Eternity, none of them appear to suffer from this.
As far as I know, those are all software-rendered ports. Vanilla Doom's software renderer can't really exhibit this behaviour as far as I know. GZDoom draws screen elements (the statusbar, weapon, menus, etc.) with the selected backend, and it does nearest neighbour resizing at non-integer scales instead of trying to force it to integer scales.
GZDoom also has interpolation for the weapon bobbing (and weapon/PSprite offsets) with non-integer coordinates, which also causes this issue.
PrBoom isn't, it also has a GL 2.1 renderer, and the issue isn't present there either.

It looks like GZDoom is kind of the odd one here with this unique anomaly.
User avatar
Redneckerz
Spotlight Team
Posts: 970
Joined: Mon Nov 25, 2019 8:54 am
Discord: Redneckerz#8399
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: Pixels of the weapon sprite being distorted during movem

Post by Redneckerz »

lowskill. wrote: PrBoom isn't, it also has a GL 2.1 renderer, and the issue isn't present there either.

It looks like GZDoom is kind of the odd one here with this unique anomaly.
''Stop right there, criminal scum! You have violated the law.'' :wink:

I kid, i kid. But since you bumped this topic, there is some information needed.
  • What version of GZDoom are you using?
    Do you have any mods/wads/pk3's loaded up?
    When does this incident most often occur?
Lastly:
Can you post a CFG as to how your GZDoom is configured? This will help with the maintainers and contributors of GZDoom to determine your issue.

This is assuming you know how to post a CFG. If not, then a Community Guide member may help you out with this.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 47983
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Pixels of the weapon sprite being distorted during movem

Post by Graf Zahl »

The issue is known, the cause for the issue is known, the main problem is that making the needed change may cause secondary issues.
User avatar
sinisterseed
Posts: 1275
Joined: Tue Nov 05, 2019 6:48 am
Github ID: sinisterseed
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Pixels of the weapon sprite being distorted during movem

Post by sinisterseed »

Graf Zahl wrote:The issue is known, the cause for the issue is known, the main problem is that making the needed change may cause secondary issues.
I'm interested.
User avatar
phantombeta
Posts: 1982
Joined: Thu May 02, 2013 1:27 am
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Pixels of the weapon sprite being distorted during movem

Post by phantombeta »

lowskill. wrote:PrBoom isn't, it also has a GL 2.1 renderer, and the issue isn't present there either.
It looks like GZDoom is kind of the odd one here with this unique anomaly.
No, PrBoom isn't. GlBoom is. GlBoom also seems to not be using non-integer coordinates, which would mean it wouldn't get the artifacts GZDoom does.
However, you can see artifacts from non-integer upscaling. Take a look at this screenshot of the pistol:
Image
Notice how the upscaled pixels aren't all the same size - that's an artifact of nearest-neighbour upscaling at non-integer scales.

There's also a pretty easy solution for anyone with a decent amount of VRAM - if you enable NormalNx upscaling at >= 3 and set filtering to (bi/tri)linear, you won't get these artifacts. This is what I do, and the game looks just fine:
User avatar
sinisterseed
Posts: 1275
Joined: Tue Nov 05, 2019 6:48 am
Github ID: sinisterseed
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Pixels of the weapon sprite being distorted during movem

Post by sinisterseed »

phantombeta wrote:
lowskill. wrote:PrBoom isn't, it also has a GL 2.1 renderer, and the issue isn't present there either.
It looks like GZDoom is kind of the odd one here with this unique anomaly.
No, PrBoom isn't. GlBoom is. GlBoom also seems to not be using non-integer coordinates, which would mean it wouldn't get the artifacts GZDoom does.
However, you can see artifacts from non-integer upscaling. Take a look at this screenshot of the pistol:

Notice how the upscaled pixels aren't all the same size - that's an artifact of nearest-neighbour upscaling at non-integer scales.

There's also a pretty easy solution for anyone with a decent amount of VRAM - if you enable NormalNx upscaling at >= 3 and set filtering to (bi/tri)linear, you won't get these artifacts. This is what I do, and the game looks just fine
That's what I meant, should've been more clear I guess (although I think you can change the render in both executables, not just glboom, but whatever).

That's an interesting artifact to be honest, but it's hard to notice (needs some eagle eyes). This however isn't, once spotted, the warping becomes somewhat hard to ignore (even if I focus on something else on the screen I can still see them warping with the corner of my eye).

Return to “Bugs”