Work in progress: higher quality scaling for OpenBOR

Plombo

OpenBOR Developer
Staff member
Hey, everyone. For the last few days, I've been working on implementing a better scaling filter to use in OpenBOR. The test image I used to start with was the original Beats of Rage title screen, upscaled to 960*540. That's a scaling factor of 2.25, the same awkward factor you get when running a 640*480 game in fullscreen on a 1080p monitor. Anyway, images are more useful than words here. First, let's look at the two existing hardware filters.

The "simple" (nearst neighbor) filter:
ADsKc6q.png


While it's the ideal option at integer scaling factors, the simple filter looks clearly awful here. 3/4 of the rows and columns of pixels from the original image are duplicated twice while the other 1/4 show up three times, and the result is that the text (and everything else, really) is badly misshapen.

The bilinear filter:
d1migc0.png


Bilinear looks the same regardless of the scaling factor. Nothing is misshapen, but everything is blurred together. The text in particular appears darker than it should, and loses its sharpness.

The new high-quality filter:
axG1h8b.png


This is the new filter I'm working on, which I want to make the default for fullscreen on PC. As you can see, it looks good even with strange scaling factors like 2.25 - the color of the text is preserved, you can still distinguish the individual pixels, and nothing is misshapen :D


While it isn't in the SVN repo yet, I've finished implementing the filter; all that's left is to properly integrate it into the options menu. It should be ready sometime next week, and if people are okay with it, I'd like it to replace bilinear as the default scaling filter for fullscreen mode. What does everyone think?
 
To explain the concept behind the new scaling filter: it's equivalent to upscaling to a higher resolution than the screen with nearest neighbor, then downscaling with bilinear filtering. So in the example above, it's basically upscaling the 320*240 image to 960*720, then downsampling to the desired 720*480. Though it's not actually implemented using two passes like that; it's done in a single pass with a fragment shader.
 
nsw25 said:
can you keep old bilinear as another option ?

I don't think he intends to remove it, just change what the default filter for full screen is. I'm sure the only reason it defaulted to bilinear before is because nearest neighbor always looked horrible. Thank you for this Plombo!
 
Viper Snake said:
nsw25 said:
can you keep old bilinear as another option ?

I don't think he intends to remove it, just change what the default filter for full screen is. I'm sure the only reason it defaulted to bilinear before is because nearest neighbor always looked horrible. Thank you for this Plombo!

Yeah, the plan is to add the new filter as a third option for the OpenGL backend and use it as the default for full screen, while keeping the other two available. (The SDL backend will still be limited to nearest neighbor and bilinear, at least for the time being.)

And that's exactly the reason why bilinear has been the default until now. Nearest neighbor could look either decent or awful,  while bilinear consistently looks at least somewhat acceptable.
 
I saw this on Twitter and was waiting for your post. Brilliant work as always Plombo.

Nearest Neighbor is the only way to go during development - but when it's time to go live, I'll be the first to admit any other filter algorithm beats it.

DC
 
Hi everyone. Sorry it's been so long since the last update on this. I've gotten hung up on the details of what to do when the filter is set to high quality and the player switches from the OpenGL backend to SDL. Should I implement the new filter in SDL even though the performance will be bad? Or automatically switch to a different filter?

Anyway, this feature is still going to happen at some point; everything is done on it except for that.
 
Personally, I like to use filters like hq2x and super eagle, but this new one looks pretty good as well. I wonder if you could add more filters or the ability for users to define additional ones?
 
Miru said:
Personally, I like to use filters like hq2x and super eagle, but this new one looks pretty good as well. I wonder if you could add more filters or the ability for users to define additional ones?

Not going to add support for any more software filters, sorry. The ones we already have are enough of a pain maintenance- and licensing-wise.
 
I am very impressed with the shots you have shown of this new filter Plombo, i must admit it has been bugging me for a while how the pixels seem off in Nearest Neighbor, and Bilinear just seems blurry, looking forward to seeing this in action.
 
Getting back to this now that I've figured out the details of how it should work. The OpenGL backend will only support high quality scaling, dropping nearest-neighbor and linear filtering, since the high quality filter looks as good or better than those in all cases. The SDL backend will continue to support nearest-neighbor and linear filtering as before, but won't have the high quality filter. OpenGL will become the default backend for both windowed and fullscreen modes.
 
so all comparisons are just made with default BOR?  not every mod is using the same sprites, other filters could still be useful for some.
 
Back
Top Bottom