shinyquagsire23 / OpenJKDF2

A cross-platform reimplementation of JKDF2 in C
Other
522 stars 46 forks source link

Anti-aliasing issue #290

Open Alfmaron opened 11 months ago

Alfmaron commented 11 months ago

Can You add option in the menu to disable Anti-aliasing? Thanks

shinyquagsire23 commented 11 months ago

AA ~should be disabled by default, the 1.0 SSAO value just means that the default resolution is exactly the window size

Alfmaron commented 11 months ago

AA ~should be disabled by default, the 1.0 SSAO value just means that the default resolution is exactly the window size

Thanks for the replay. I removed AA in the previous version of jkgm.json that was like this: { "resolution": [ 1024, 768 ], "fullscreen": true, "correct_game_aspect_ratio": false, "correct_menu_aspect_ratio": true, "hud_scale": 1.0, "max_anisotropy": 2.0, "antialiasing": { "type": "MSAA", "samples": 2 }, "enable_bloom": true, "enable_ssao": true, "enable_parallax": true, "enable_texture_filtering": true, "enable_posterized_lighting": false, "enable_vsync": false, "command": "jk.exe" }

Removed the MSSA part of the code and AA would be disabled. Can You add an option in the menu for changing the MSAA settings from OFF to 2,4,8?

shinyquagsire23 commented 11 months ago

Oh I don't actually read jkgm.json, and I've not actually implemented MSAA (yet). The only part of jkgfxmod which OpenJKDF2 reads is the assets/folders/metadata in jkgfxmod/.

Alfmaron commented 11 months ago

Ok, great so in the future You will add MSAA support as I understand. I need to disable the MSAA for the Reshade to how access to depth buffer. I like what Reshade offers in terms of changing visuals. If You have an idea how to disable AA let me know. Thanks for the replay.

shinyquagsire23 commented 11 months ago

Ahhh ok reshade you'll probably run into issues, it's probably not an AA issue though. Because JKDF2 is so old, it never did camera projection on the GPU. The consequence of this is that all reshade will see is a bunch of flat triangles.

It's also not a trivial fix unfortunately, because they optimized their entire renderer, map format and culling based on screenspace coordinates and software rendering. Modernizing the renderer is on my TODO list for VR experiments, because all VR runtimes also expect you to use MVP projection matrices, same that Reshade probably expects.

Alfmaron commented 11 months ago

Ahhh ok reshade you'll probably run into issues, it's probably not an AA issue though. Because JKDF2 is so old, it never did camera projection on the GPU. The consequence of this is that all reshade will see is a bunch of flat triangles.

It's also not a trivial fix unfortunately, because they optimized their entire renderer, map format and culling based on screenspace coordinates and software rendering. Modernizing the renderer is on my TODO list for VR experiments, because all VR runtimes also expect you to use MVP projection matrices, same that Reshade probably expects.

I did manage to make it work on Jedi Knight Remastered 2.0 but it doesn't work with on Jedi Knight Remastered 3.2 because I can disable AA like in 2.0 version. In 2.0 I just deleted
"antialiasing": { "type": "MSAA", "samples": 2 from jkgm.json, adjust the Reshade depth buffer and it worked. So on Jedi Knight Remastered 2.0 works and I wondered how to the same in new version. Here's a video if You like to see that Reshade depth buffer works on older version https://www.youtube.com/watch?v=9EArPBdVifg VR sounds very cool! Thanks for the replay

LadyEebs commented 2 months ago

FYI Reshade and MSAA don't mix well when you're using any depth-buffer based effects. The SSAO in OpenJKDF2 won't work with MSAA either without heavy work (MSAA and deferred don't like to mix). Not even sure the glow/blur thing will work out well either.

A better alternative to SSAA would be some form of post-AA. TAA is off the table (I don't like it and it requires motion vectors which is expensive as hell with the current CPU-based clipping and projection, I already tried to do that for some motoion blur experiments). But SMAA or FXAA could suffice since JK is not the type of game prone to many issues with those techniques (I still don't love 'em but anyway). You could mix that with SSAA to avoid cranking it to high, too.