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)
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)
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:
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.
Offset issue with DrawBar
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
-
- Lead GZDoom+Raze Developer
- Posts: 49190
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Offset issue with DrawBar
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.
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.
-
- Posts: 5032
- Joined: Sun Nov 14, 2010 12:59 am
Re: Offset issue with DrawBar
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:
So in light of that, I'd like if this issue is looked into again.
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:
So in light of that, I'd like if this issue is looked into again.
-
- Lead GZDoom+Raze Developer
- Posts: 49190
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Offset issue with DrawBar
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.