Accurate HUD Scaling at Lower Resolutions

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Accurate HUD Scaling at Lower Resolutions

Re: Accurate HUD Scaling at Lower Resolutions

by speedy » Mon May 31, 2021 4:54 pm

I wanted to add a couple more details for anyone else who may stumble on this thread...

I had to set r_noaccel true for scaling to avoid scaling issues on certain sprites on my weapon. Rachel mentioned to me that this is likely due inefficiencies with the float datatype. You can see the issue here: https://youtu.be/nwiFsROPJtQ

Doing this also requires switching to the "Doom Software Renderer" or "True Color SW Renderer" which I preferred regardless because of the vanilla look I was going for.

Re: Accurate HUD Scaling at Lower Resolutions

by Rachael » Mon May 03, 2021 7:52 am

speedy wrote: Rachel showed me on Discord how to do this (THANK YOU!).
You're welcome.

It shouldn't be this hard to do it, but the main reason why I haven't extended the code further is due to extension after extension the code has been in desperate need of refactoring that I just haven't gotten around to yet. It's a mess, and I am ashamed that I let it get so bad, but it's why I am not adding features to it right now.

Re: Accurate HUD Scaling at Lower Resolutions

by speedy » Mon May 03, 2021 12:08 am

You need to do the math yourself to set custom scaling like this...

ScaledY / NativeY = Y * NativeX = X * 1.2 = ScaledX

You'll always know your ScaledY because that's the vertical resolution you want to achieve (400p in my case). You're solving for the ScaledX.

Then run the command:
vid_setscale ScaledX ScaledY 0 1.2

For example, my laptops LCD is 2880x1800 so I'd calculate like this:
400 / 1800 = .222 * 2880 = 640 * 1.2 = 768

So I ran the command:
vid_setscale 768 400 0 1.2

Now my HUD looks perfect and I have a nice 400p widescreen render resolution.

Rachel showed me on Discord how to do this (THANK YOU!).

Re: Accurate HUD Scaling at Lower Resolutions

by Graf Zahl » Sun May 02, 2021 2:35 pm

If you use a size too close to your actual resolution that isn't a whole factor, such artifacts are unavoidable.

Let's say you want to stretch 200 pixels to a display size of 300. The only way to achieve this is to double each second pixel so you have a display of 1/2/1/2 and so on.
Those small sizes like 320x200 and 640x400 are only 1/5th or 1/6th, so you alternate between a scaling of 5/6 or 10/11 screen pixels per source pixel at which the effect is barely noticable. The closer you get to your real screen size, the more noticable it gets.

Accurate HUD Scaling at Lower Resolutions

by speedy » Sun May 02, 2021 12:49 pm

I've noticed when using 640x400 or 320x200 mode on my 2880x1800 HiDPI laptop LCD that the HUD's pixels seem to be scaled correctly even with linear filtering set to None...

But, if I switch to a Normal + 0.25 scale or use the "Lowest Possible Scale" mode the HUD's pixels aren't scaled properly (referring to vertically mostly) - some lines/pixels look like they're sometimes double-height where others are correct.

Is there a way to address this so I can play in widescreen with chunky pixels and have a HUD that appears to be scaled correctly?

Thanks!

Top