gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
754 stars 174 forks source link

Disabling Bilinear Filtering in Newer Builds #2794

Open AlterSpectrum opened 11 months ago

AlterSpectrum commented 11 months ago

Not sure if anyone can help here me with an issue I’ve been experiencing. I should preface this by stating that I am not a coder or programmer and have very little experience with the technical aspects of graphical plugins for emulators.

Basically, I am trying to find out how and why certain versions of the GLideN64 plugin allow me to disable (most of) the bilinear filtering and some do not. As there is no option to disable bilinear filtering in the plugin menu itself I discovered that I could do so by editing the .ini file and changing the “bilinearMode=” value to “2”. This would deselect both the “Standard” and “N64-style 3 point” bilinear filtering options on the video settings of the plugin. See below:

Screenshot 2023-08-08 233414

I was really happy with the results because a lot of sprite/2D centric games, such as Paper Mario, looked really crisp and clean. I personally despise the look of bilinear filtering in all forms as it smears and smudges the pixel art which I find is very ugly. There are still a few odd textures here and there (like the grass texture below) that still remain bilinear filtered but the result is very good. See below:

bilinear off

Now you may be wondering what the problem is. Unfortunately there are some issues with earlier versions of the plugin with games like Paper Mario. The main two being the slow sub screen loading/lag and “zoom-in” bug. See below for topics about these issues:

Loading: https://github.com/gonetz/GLideN64/issues/2760

Zooming-in: https://github.com/gonetz/GLideN64/issues/1789

The solution is obviously to use the fixed versions of the plugin gonetz made or the most recent version which appears to have also fixed the issues. However I have discovered that I am unable to use the same trick I used in earlier versions of the plugin (manually editing the .ini file) to disable bilinear filtering. After lots of testing with different builds it seems that most versions prior to version 19 allow me to disable bilinear filtering via the .ini file. Unfortunately though none of these seem to have the sub screen loading and zoom-in bugs fixed. It also seems like gonetz is not interested in implementing options for nearest neighbour or force point sampled directly in the menu which is a big shame as that would resolve all the issues I am experiencing.

Is there a way to disable bilinear filtering via the .ini file in the most recent releases of the plugin (e.g version 29, build ‘0fee30d’)? If I open the .ini for version 29 and change “bilinearMode=” to “2” it does deselect the two bilinear filtering options. However this isn’t reflected in the game itself and appears like the “N64-style 3 point” option is selected. See below:

bilinear on

If anyone can shed some light onto this I’d really appreciate it as I feel like I’ve tried everything at this point. Thanks!

weinerschnitzel commented 11 months ago

N64 has 3 point bilinear filtering. The bilinear/3 point options switch between 3 point (n64) and 4 point (modern) bilinear filtering for filtered textures.

There is currently no option/hack to force all filtering to nearest neighbor.

The discussion in #2088 recommends using the hybrid filter feature, and some cases show better results than forcing nearest neighbor with a hack.

Give hybrid filter a shot on a newer build, there is also #574 to request a force nearest neighbor option.

AlterSpectrum commented 11 months ago

Thanks for replying. Forgive my ignorance but how do I enable the hybrid filter. Is there an option in the menu interface or do I need to modify the .ini file in some way? I am using the 3.0.1 version of Project64.

Jj0YzL5nvJ commented 11 months ago

The setting in question is marked as ini only. Therefore, it can't be manipulated from the GUI. https://github.com/gonetz/GLideN64/blob/0fee30d010d1feda7d343654871b3dfd05ccab70/src/GLideNUI/Settings.cpp#L58-L60

AlterSpectrum commented 11 months ago

Do I just copy and paste that stuff directly into the GLideN64.ini file? Again sorry but I'm very inexperienced when it comes to understanding the specifics of this kind of thing.

Jj0YzL5nvJ commented 11 months ago

I don't use PJ64, but by reverse engineering the other similar values, just add:

generalEmulation\enableHybridFilter=0

To [PAPER%20MARIO] in GLideN64.custom.ini...

P.S: I don't understand the GLideN64.ini purpose... initialization maybe?

AlterSpectrum commented 11 months ago

I don't use PJ64, but by reverse engineering the other similar values, just add:

generalEmulation\enableHybridFilter=0

To [PAPER%20MARIO] in GLideN64.custom.ini...

P.S: I don't understand the GLideN64.ini purpose... initialization maybe?

Unfortunately that didn't seem to do anything. Thanks for trying though.

gonetz commented 10 months ago

The hybrid filter is enabled by default for desktop builds. This filter works when image is magnified. It is recommended to set Internal resolution to Original (1x native) for 2D games like Paper Mario. In that mode you will get crisp and clean image, free of bilinear filtering artefacts, which can appear with high resolutions.

AlterSpectrum commented 10 months ago

Thanks for the response gonetz. I think I have it working but due to the resolution being so low (accurate to the original hardware) the pixels are very large and you lose a lot of detail in the image.

Here's what Paper Mario looks like with hybrid filter on: hybrid on

And here's it with hybrid filter off (running on rev.8004dc2) with the .ini file edit: hybrid off

Despite inaccuracy to original hardware I definitely think the second image looks better.

Are there any recent builds that still allow the .ini tweak (mentioned in the first post) to work?

Bruszan commented 9 months ago

Also wanted an update on this, we want to play Paper Mario with high resolution and without the bilinear filtering on textures, I hoped that putting generalEmulation\enableHybridFilter=0 or 1 would solve it but it also didn't change for me.

Is the hybrid filter really enabled by default? The one we want to see implemented is the one found in #2088, but from my testing this is what I get:

image

Some textures that are filtered and some that aren't, just like Nintendo re-releases; But we would love to be able to force all textures to not be filtered, and this is what the Nearest Neighbour/Hybrid filter on that issue was able to achieve as it looks like, or am I getting something wrong?

We really want that option back as I see many issues regarding people that want to see it in games like Paper Mario, wish the Hybrid filter was in recent builds under the "Bilinear filtering" section (as Disabled or Sharp) or at least make so that by putting the mentioned parameter on the .ini file would work.

weinerschnitzel commented 9 months ago

I had it wrong with my suggestion.

Hybrid filter scales the native resolution picture nicely, letting the n64 bilinear filter look correct when magnified.

You guys want to disable n64 texture filtering/force it to NearestNeighbor, and to use a higher resolution.

There is not any workaround to achieve it right now, or at least that i know. The feature would have to be implemented.

I think it is a good time to consider it.

Bruszan commented 9 months ago

An option to at least force it to Nearest Neighbor together with the bilinear filtering options like in Glide64 would be already a bless, we talk about Hybrid filter because it was already made before and it showed less image distortion, the best of both worlds.

The implementation of the Hybrid filter solved #2088 but now is a issue again because we can't use it on recent builds for some reason, not even by changing the .ini files like Jj0YzL5nvJ mentioned above which seemed like a ini only feature. We're stuck with bilinear or 3-point only for now.

ghost commented 7 months ago

I would also like to be able to use nearest filtering on all textures if possible, hopefully the feature gets implemented

Papermanzero commented 3 months ago

I would also like to be able to use nearest filtering on all textures if possible, hopefully the feature gets implemented

It is a long discussion. In general the best possible way would be to have two options. Filtering: N64 Standard, Sprites & Textures, None Filtering Method: Tri-Point standard, Bilinear, xbrz, sai etc.