cdozdil / OptiScaler

OptiScaler is middleware that enables various upscaling technologies in DLSS2-only games. It allows non-Nvidia users to use upscaling by applying DLSS2 inputs to XeSS, FSR2, or FSR3.
MIT License
565 stars 12 forks source link

Possible to implement forced anisotropic filtering? #26

Closed aufkrawall closed 3 months ago

aufkrawall commented 3 months ago

Since OptiScaler can already force mip map bias, would it be possible to implement forced anisotropic filtering as an optional feature? The AMD D3D12 driver unfortunately still can't force it, and while forcing it may cause issues in some games, it can improve visuals in others where game devs e.g. apply questionable "optimizations" with low anisotropic filtering values for some textures etc. Thanks!

cdozdil commented 3 months ago

Hi,

I have prepared a test build for anisotropy overriding. You can force it from nvngx.ini (better use this one) or from in-game menu. If you force it from menu probably need to change resolution or DLSS preset to activate changes.

[Hotfix]
; Override max anisotropy for textures
; 2, 4, 8, 16 - Default (auto) is disabled
AnisotropyOverride=auto

I have tried to limit override to Bilinear, Trilinear and Anisotropic filtered textures but might cause issues with menus and other 2D stuff.

nvngx-force-aniso-test.zip

aufkrawall commented 3 months ago

Thanks a lot for your efforts!

It seems with this build, there already is some issue with mip mapping (?) with default settings: witcher3_2024_07_29_15_31_01_283

cdozdil commented 3 months ago

Ah yes made a copy/paste mistake, here is the fixed one 😊

And fixed a possible menu crash 😅

nvngx-force-aniso-test-3.zip

aufkrawall commented 3 months ago

It works now, fantastic. :)

Probably a regression: It always shows the current mip bias as 0, whereas stable build v0.6.5 reports it as -2 with DLSS Performance selected in-game.

cdozdil commented 3 months ago

Yeah, noticed and fixed that after sending you the build 😊

cdozdil commented 3 months ago

This build should fix it : https://github.com/cdozdil/OptiScaler/actions/runs/10147988156

aufkrawall commented 3 months ago

Hm, still shows 0. I've also noticed that saving the aniso value to config file from OSD doesn't work. :)

cdozdil commented 3 months ago

This build should fix both of the issues

https://github.com/cdozdil/OptiScaler/actions/runs/10170882440

aufkrawall commented 3 months ago

Confirmed fixed. :)

Maybe one more nitpick (hope this doesn't get too annoying): When adjusting only the aniso value in OSD and not touching the mip bias bar, I think it shouldn't force mip bias to 0 (both runtime and when writing to config).

cdozdil commented 3 months ago

Unless you click the set button it won't set mipbias. For anisotropy you don't need to click set, maybe putting anisotropy under set button makes it more obivous 👍

aufkrawall commented 3 months ago

Alright, makes sense. Closing now, thanks a lot! This is such an amazing tool.