Helion-Engine / Helion

A modern fast paced Doom FPS engine
GNU General Public License v3.0
86 stars 9 forks source link

Fullscreen HUD doesn't use 1.2× vertical 2D scaling like the status bar #552

Closed Calinou closed 5 months ago

Calinou commented 8 months ago

Helion version: https://github.com/Helion-Engine/Helion/commit/3e60de303e27c74738b6e98e125ffb48a552c2cd

Notice how the text and mugshot are vertically squashed on the fullscreen HUD compared to the status bar.

Status bar

image

Fullscreen HUD

image

Pixel-perfect 2D scaling can only be achieved by a 2D scale factor of 5× (so each 5×5 square becomes 5×6), so this may have to be optional as it may not look great at scale factors between 1× and 3×.

nstlaurent commented 8 months ago

Is the problem that the first screenshot is rendering the sprites differently compared to the second? I don't understand the last statement about pixel-perfect 2D scaling if you could clarify, thanks :)

Calinou commented 8 months ago

Is the problem that the first screenshot is rendering the sprites differently compared to the second?

The first screenshot is correct, the second screenshot is wrong (compared to the expected appearance).

I don't understand the last statement about pixel-perfect 2D scaling if you could clarify, thanks :)

See https://zdoom.org/wiki/Aspect_ratio_correction. The vertical scale factor is 1.2×, so you need a scale factor of 5×[^1] to be able to represent it without any uneven pixel scaling (i.e. each pixel that is 5×5 pixels becomes 5×6). Otherwise, some rows of pixels will be 1 pixel taller than others. It's a similar problem to integer scaling but with a larger multiplier.

[^1]: Multiples of 5× will also work, though 10× is too large even on a 4K display.

nstlaurent commented 8 months ago

Thanks, I just wanted to be sure. Funny enough, Odamex does the same thing between the full and minimal HUD and I never noticed it there either.

I fixed the sprites for the minimal HUD so they render to match the full sized HUD.

screenshot_Helion Debug_DOOM

Calinou commented 8 months ago

I fixed the sprites for the minimal HUD so they render to match the full sized HUD.

Looks good, could you also apply this to the HUD font? It still seems squashed as far as I can tell.

nstlaurent commented 8 months ago

Thought that was going to be more difficult. Ended up being easy so that is done as well.

screenshot_Helion Debug_DOOM

Calinou commented 8 months ago

Looks great! I think all that's missing now is the console text at the top (also in the options menus), but this may be more involved and may not look great at low scale factors. Some source ports allow configuring text scaling independently from the HUD for this reason.

nstlaurent commented 5 months ago

Completed.