DaemonEngine / Daemon

The Dæmon game engine. With some bits of ioq3 and XreaL.
https://unvanquished.net
BSD 3-Clause "New" or "Revised" License
304 stars 60 forks source link

FXAA is done over SSAO #536

Open illwieckz opened 3 years ago

illwieckz commented 3 years ago

In order to investigate #533, I modified the FXAA GLSL code to mark as red the pixel selected by the GLSL shader for applying antialiasing. And I discovered that FXAA was trying to do antialiasing on the pixels drawn by the SSAO code:

You can see the red pixels near to the gun, they are pixels written by SSAO painted in red by the FXAA code with my modification.

fxaa on ssao

illwieckz commented 3 years ago

I'm not sure if we can fix both this issue and #537 at the same time because to fix this issue we should do FXAA before SSAO but to fix #537 we may have to do SSAO before fog, so before FXAA.

If we can only fix one issue and have to make a choice, the issue to fix is #537:

VReaperV commented 2 months ago

Doing anti-aliasing before SSAO seems to me like it could produce artifacts, since SSAO uses the depth buffer, and the depth of fragments where the fragments were affected by FXAA might no longer match the original fragment's depth.