VOGONS

Common searches


First post, by kurkosdr

User metadata
Rank Newbie
Rank
Newbie

For quite a while, I have been using the "normal2x" scaler (along with ddraw output) to scale my 640*480 games to 1280*960 (windowresolution is set to this resolution in the settings). This is effectively results in 2x scaling by line repeat, which is a decent scaling option in my opinion (it doesn't introduce artifacts/spurious detail like the more advanced scalers do).

However, some old 1280*960 LCD monitors had a better way of upscaling a 640*480 image by averaging the lines. Basically, they took the 1st and 2nd line, and averaged the values to create a new line in-between, and then the 2nd and 3rd line to create a new line, and so forth, for both dimensions (first vertical, then horizontal). This resulted in a 1279*959 picture that was very smoothly scaled. Usually the last line in both dimensions was repeated to create a 1280*960 image.

This is actually something we use a lot in the video industry, for example to scale 352*240 to 704*480. It results in absolutely zero artifacts/spurious detail while remaining smooth (no jaggies).

Is it possible to achieve something similar with DOSBox? I know you can use the opengl output to get bilinear , but I don't know if this"bilinear" achieves the above effect when used at 2x the window resolution. And what should I set the "scaler" option to? "normal2x" or "none"?

Reply 1 of 7, by Delfino Furioso

User metadata
Rank Newbie
Rank
Newbie

the recently added shaders support might provide you with the desiderd results

you should try out one of the latest SVN vanilla build
https://www.dosbox.com/wiki/SVN_Builds#Plain. … lean_SVN_builds

and set up your configuration as follows:
fullscreen=false
windowresolution=1280x960
output=opengl
scaler=none
glshader=sharp

Reply 2 of 7, by Ringding

User metadata
Rank Newbie
Rank
Newbie

Bilinear is basically averaging. Thinking about the positioning of the picture, it will most likely be offset by half a pixel compared to your method, so no original lines will remain, as every one will be a linear combination of two input lines. I have not played with the shaders myself, although this is on my to-do list, but I am afraid that your method is not achievable without additional patching. This is all just speculation, though. The pixel-perfect guys might be able to contribute here.

Reply 3 of 7, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie
Ringding wrote on 2020-12-29, 12:24:

Bilinear is basically averaging. Thinking about the positioning of the picture, it will most likely be offset by half a pixel compared to your method, so no original lines will remain, as every one will be a linear combination of two input lines. I have not played with the shaders myself, although this is on my to-do list, but I am afraid that your method is not achievable without additional patching.

Adding (or subtracting) a quarter-pixel to the uv co-ordinates in the fragment shader would do it (assuming the output size is exactly double the input size).

Reply 4 of 7, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

I tried implementing this to see what it looked like, the answer: bloody terrible. Don't stare at it too long or you'll feel like you need glasses.

This is why a proper bilinear 2x resize uses alternating weights of 0.75/0.25 instead of 1.0/0.5.

Reply 5 of 7, by kurkosdr

User metadata
Rank Newbie
Rank
Newbie
jmarsh wrote on 2020-12-30, 12:32:

I tried implementing this to see what it looked like, the answer: bloody terrible. Don't stare at it too long or you'll feel like you need glasses.

This is why a proper bilinear 2x resize uses alternating weights of 0.75/0.25 instead of 1.0/0.5.

How is this terrible? It preserves all image data intact without any jaggies. Are we pretending our 640x480 games are suddenly HD and hence must have sharp edges, image accuracy be damned?

Do you know how I can get this result myself? That's what I am looking for.

PS: I agree text looks a bit blurry, but something like software-rendered Screamer Rally would look very good.

Reply 6 of 7, by jmarsh

User metadata
Rank Oldbie
Rank
Oldbie

Make sure you are viewing the image at its original size (1280x960).

The problem is it adds a "hard" fuzzy edge to everything, which makes it look as if it's out of focus. A standard bilinear resize (which is what is actually used in the video industry - it's the default resampling algorithm on all video cards, after all) compensates for this.

Reply 7 of 7, by kurkosdr

User metadata
Rank Newbie
Rank
Newbie
jmarsh wrote on 2020-12-31, 01:34:

Make sure you are viewing the image at its original size (1280x960).

The problem is it adds a "hard" fuzzy edge to everything, which makes it look as if it's out of focus. A standard bilinear resize (which is what is actually used in the video industry - it's the default resampling algorithm on all video cards, after all) compensates for this.

Ok, I would still use it for certain types of games. Is there a way I can have it?