Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anti-Alias & anisotropic filtering support #49

Open
Shadowboxer2005 opened this issue Oct 5, 2018 · 8 comments
Open

Anti-Alias & anisotropic filtering support #49

Shadowboxer2005 opened this issue Oct 5, 2018 · 8 comments

Comments

@Shadowboxer2005
Copy link

Could you add Anti-Alias & anisotropic filtering support so you can enable in the 2005 version?

@RinMaru
Copy link

RinMaru commented Oct 5, 2018

you can already do that through your GPU

@michael-fadely
Copy link
Contributor

Yep, the reason I opted out of implementing this is that AMD and NVidia's control panels can both provide higher quality MSAA than the standard MSAA that D3D would enable. Might be worth adding at least anisotropic filtering though--that's one thing that you can accidentally crank way up and not wreck performance.

@cheatfreak47
Copy link

cheatfreak47 commented Oct 6, 2018

It's worth noting that some older GPUs don't have drivers that allow enforced anti-aliasing, or in some cases where they do, they enforce it globally, so including an option to do it with direct3D might be worthwhile anyway.

Not that I even really like anti-aliasing personally, but I can definitely see use cases where having it added would be beneficial.

@michael-fadely
Copy link
Contributor

I could do it with my below-spec GeForce FX 5200.

@PiKeyAr
Copy link
Member

PiKeyAr commented Sep 19, 2024

Bumping this since recently after switching to AMD RX6800 I found out there's no way to enable anti-aliasing in this game without hacks. The settings related to anti-aliasing in AMD Software do absolutely nothing with SADX but they do work with SA Tools. I was only able to turn on anti-aliasing by installing DXWrapper and forcing anti-aliasing in its settings. Anisotropic filtering can't be forced in the driver either if the D3D9On12 wrapper is installed.

I will implement support for setting anti-aliasing and anisotropic filtering in the loader. This will need to be exposed in SA Mod Manager as well.

@PiKeyAr
Copy link
Member

PiKeyAr commented Sep 19, 2024

Update: Anti-aliasing not forced through the AMD driver was caused by the Mod Loader setting D3DSWAPEFFECT_COPY_VSYNC when VSync is enabled, while D3D9 apparently requires D3DSWAPEFFECT_DISCARD for multisampling. Since D3DSWAPEFFECT_COPY_VSYNC was removed in D3D9 anyway, I made it set D3DSWAPEFFECT_DISCARD when the game is running in D3D9 mode. Forcing anti-aliasing through the driver now works correctly.

@PiKeyAr
Copy link
Member

PiKeyAr commented Oct 6, 2024

Update 2: Sora claims D3DSWAPEFFECT_DISCARD causes stuttering so they removed the fix. Anti-aliasing is no longer possible again without turning off VSync. I'm not sure how D3DSWAPEFFECT_COPY_VSYNC behaves in Direct3D 9 since MS docs sat it was removed, probably just switches over to D3DSWAPEFFECT_COPY.

@PiKeyAr
Copy link
Member

PiKeyAr commented Nov 12, 2024

Update 3: Antialiasing and anisotropic filtering can now be configured in the loader JSON file. Example:

 "Graphics": {
    "Antialiasing": 16,
    "Anisotropic": 8,

Possible values:
Antialiasing: 0 (disabled), 2, 4, 8, 16.
Anisotropic: 0 (disabled) to 16.

Note that the antialiasing option is using D3D multisampling so it requires setting swap effect to D3DSWAPEFFECT_DISCARD, which can cause stuttering. The swap effect is changed only if the value is other than the default 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants