axx0/Civ2-clone

Feature Request: use Bilinear/Bicubic interpolation scaling on zooming

Closed this issue · 10 comments

Hello. First of all, I post here since it seems that Github is the only active place of the Civ2 clone project. I'm sorry if the Issues section is not the right place to post feature requests.

One thing that Civ2 bugs me is it use nearest-neighbor interpolation scaling when zooming in/out. This cause two problems:

First, graphic looks pixelated when zooming in. Back in 1999, when played Civ2 with a CRT screen, this problem was inconspicuous since CRT screens have built-in anti-aliasing. But this problem becomes obvious when using a modern LCD screen.

Pixelated graphic when zooming in:
1

Second, a even more serious problem cause by nearest-neighbor interpolation is that, graphics distorted when doing non-integer scaling. And all unit graphic in UI of Civ2 are scaling non-integerly.

Here you can see the pikes and lances (which supposed to be straight) of the units are seriously distorted:
2

Using bilinear/bicubic interpolation scaling on zooming can fix the problem. So I request that, if possible, add an option to enable bilinear/bicubic interpolation scaling in the Civ2-clone project.

Thanks for reading my post!

axx0 commented

Hi,
Raylib offers these options for texture filtering:

Clipboard02

Doing:
a) point ("no filter, just pixel approximation")
b) bilinear ("linear filtering")
c) trilinear
with 8 scaling factors (1, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75) I get these results:

Clipboard

There are probably more options for texture graphics in raylib.
Does this help?

Hi, Raylib offers these options for texture filtering:

Clipboard02 Clipboard02

Doing: a) point ("no filter, just pixel approximation") b) bilinear ("linear filtering") c) trilinear with 8 scaling factors (1, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75) I get these results:

Clipboard Clipboard

There are probably more options for texture graphics in raylib. Does this help?

Thanks for the reply. Of course that help! That is exactly what I talked about.

Personally I prefer bilinear/trilinear filtering (both actually look almost the same in the context of Civ2). But the best way might be adding different filtering as options in settings, in case some players prefer the old "sharp pixel" look of point filtering.

axx0 commented

Adding this as option shouldn't be a problem. I'll keep this issue open until we get there.

crhy commented

THIS IS SO AWESOME! Best game ever and finally a version that might be playable on modern hardware?!?! Let me know if you want artwork to recreate it as a fully FOSS stand alone. I'm down to help.

axx0 commented

You mean using custom resources so we're not dependent on the original's artwork?

crhy commented

Yes exactly! The original art is not great anyway, and I'm pretty handy in the GIMP. Would love to do a retexture, then we could eventually come up with a fully FOSS release.

crhy commented

We could just use AI image creation. Would be hyper fast I bet.

crhy commented

I've redone most of the assets in the game already. Just waiting for an upload folder. Going to look WAY better. :) AND we can go full FOSS! :D

axx0 commented

@IVENEND I've finally added option for texture filtering in settings .json file.
Example (TextFilter=0 is left, TextFilter=2 is right)
02

crhy commented

AWESOME! But bear in mind that the new artwork is MUCH higher res, so this may not be as essential moving forward. Anyway: YAY PROGRESS! <3

I'm really excited about trying out a beta on Android, and having additional features, like disabling global warming, or nukes...