[Can't fix] Offset issue with DrawBar

Bugs that have been investigated and resolved somehow.

Moderators: Developers, ZDoom.org Team

Offset issue with DrawBar

Postby Blue Shadow » Fri Jun 16, 2017 10:13 pm

Tested/produced with: 3.1.0 64-bit, 3.2pre-64-g2ff492d 64-bit


There seems to be an offset problem with DrawBar when drawing the bar reversed (passing SHADER_REVERSE flag):

(Click for full size)
Image

The two bars you see are drawn exactly the same, with the exception that the bottom one is drawn in reverse, yet it's offset by on pixel to the left. Oddly, if you scale the HUD up like say 2x, the bar is drawn correctly.

(Click for full size)
Image

Now, this appears to affect some screen resolution, like 800x600 and 1024x768. On 1366x768, the biggest I can test this on, the bar is drawn fine.

Here is a demo file:

bar_test.pk3
(2.29 KiB) Downloaded 7 times

To test, load it with Doom. Switch to the fullscreen HUD while making sure to disable scaling. From the console: 'give ammo'. Fire your pistol seven times.

And as not to overlook this: the non-reversed bar (the top one) is drawn perfectly fine regardless of resolution or HUD scale.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010

Re: Offset issue with DrawBar

Postby Graf Zahl » Sat Aug 12, 2017 5:44 am

If you do not draw at the same coordinates there's no guarantee that it will end up at the same coordinate.
This is simply a rounding problem when the values get scaled. Since ultimately they end up on a display consisting of discrete pixels it can just happen that the values differ by 1.
Sorry, but this cannot be changed.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Offset issue with DrawBar

Postby Blue Shadow » Fri Sep 29, 2017 10:33 pm

I know this is closed and all, but please, bear with me.

Since I have never encountered this issue with SBARINFO before, I thought I'd recreate the demo, only this time using SBARINFO instead of ZScript. The result of the test? No offset issue whatsoever.

Here's the file:

bar_test_sbar.pk3
(1.89 KiB) Downloaded 3 times

So in light of that, I'd like if this issue is looked into again.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010

Re: Offset issue with DrawBar

Postby Graf Zahl » Sat Sep 30, 2017 12:43 am

I can only repeat what I said: If you do not use the same coordinates to draw at you depend on how scaling is performed and how the rendering hardware handles slight coordinate mismatches. It may work in some resolutions but not in others - but at the end of the day the entire thing depends on floating point rounding. This is mathematically not fixable with a low level approach.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest