SDL linear filtering

Discussion of development and patch submission.
Post Reply
Nightblair
Posts: 2
Joined: Tue 24 Jul, 2018 2:51 pm

SDL linear filtering

Post by Nightblair » Sun 29 Jul, 2018 8:28 am

When emulating proper 4:3 aspect ratio, I use filtering to prevent oddly shaped pixels. In dosbox this looks fine with normal3x scaler. However in pcem the image is sligtly more blurry which unfortunately gives me a headache after a while.
So I've digged into the code and found that pcem is using SDL library linear filtering to do the job from the base input (if I read the code correctly). Then I've got this idea if the image is integer scaled first to higher resolution with nearest filtering with SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "0") and then rescaled to 4:3 format, would the result be better, less blurry?

I've tried to do it myself, however I'm completely unfamiliar with c and SDL2, so I failed.

Do you think the theory is reasonable, though?
Last edited by Nightblair on Mon 30 Jul, 2018 5:45 am, edited 1 time in total.

User avatar
leilei
Posts: 568
Joined: Fri 25 Apr, 2014 4:47 pm

Re: SDL linear filtering

Post by leilei » Mon 30 Jul, 2018 12:53 am

If you were to have actual normal3x in PCem, you'd see this applied as normal6x as PCem properly emulates double-scanned VGA.

Your best bet is a OpenGL 3.0 shader preset of some kind...

Nightblair
Posts: 2
Joined: Tue 24 Jul, 2018 2:51 pm

Re: SDL linear filtering

Post by Nightblair » Mon 30 Jul, 2018 5:45 am

It does not neccesarily be like normal3x, but good point with the double scanned mode. If I use the scale function with SDL hinting off, then it might be set correctly.

I've tried some shaders from retroarch but so far no luck with any. Also, for some reason the OpenGL3 mode takes a toll on my processor a lot more than normal opengl mode.

Post Reply