Opened 4 years ago

Closed 3 years ago

#5677 closed enhancement (fixed)

Sharpening Pass

Reported by: OptimusShepard Owned by: OptimusShepard
Priority: Should Have Milestone: Alpha 24
Component: Core engine Keywords:
Cc: Patch: Phab:D2642

Description (last modified by OptimusShepard)

The new antialiasing implementation FXAA makes the game a little bit blurry. Therefor a sharpening pass should be implemented. The level of sharpen could be selectable by slider.

AMD has released a free implementation on git, which seems to be the current best one, which is available. https://github.com/GPUOpen-Effects/FidelityFX/tree/master/FFX_CAS

It has been already ported to reshade. https://wccftech.com/amd-fidelityfx-cas-got-ported-to-reshade/

In the following I made some screenshots with reshade. The settings are CAS=off, CAS=0.0, CAS=0.3, CAS=0.5 and CAS=1.0. Good noticable on the detailed tree shadows, and textures of bulding and ground.

No CAS Non CAS

0.0 CAS 0.0 CAS

0.3 CAS 0.3 CAS

0.5 CAS 0.5 CAS

1.0 CAS 1.0 CAS

Attachments (10)

Non CAS.jpg (634.6 KB ) - added by OptimusShepard 4 years ago.
No CAS
00 CAS.jpg (759.9 KB ) - added by OptimusShepard 4 years ago.
0.0 CAS
03 CAS.jpg (791.3 KB ) - added by OptimusShepard 4 years ago.
0.3 CAS
05 CAS.jpg (815.0 KB ) - added by OptimusShepard 4 years ago.
0.5 CAS
10 CAS.jpg (943.9 KB ) - added by OptimusShepard 4 years ago.
1.0 CAS
Non CAS.png (801.5 KB ) - added by OptimusShepard 4 years ago.
No CAS
00 CAS.png (877.9 KB ) - added by OptimusShepard 4 years ago.
0.0 CAS
03 CAS.png (957.8 KB ) - added by OptimusShepard 4 years ago.
0.3 CAS
05 CAS.png (984.6 KB ) - added by OptimusShepard 4 years ago.
0.5 CAS
10 CAS.png (1.0 MB ) - added by OptimusShepard 4 years ago.
1.0 CAS

Change History (24)

by OptimusShepard, 4 years ago

Attachment: Non CAS.jpg added

No CAS

by OptimusShepard, 4 years ago

Attachment: 00 CAS.jpg added

0.0 CAS

by OptimusShepard, 4 years ago

Attachment: 03 CAS.jpg added

0.3 CAS

by OptimusShepard, 4 years ago

Attachment: 05 CAS.jpg added

0.5 CAS

by OptimusShepard, 4 years ago

Attachment: 10 CAS.jpg added

1.0 CAS

comment:1 by OptimusShepard, 4 years ago

Description: modified (diff)

comment:2 by Vladislav Belov, 4 years ago

It'd be better to use PNG or any other lossless image formats. Because sharpness difference isn't so visible because of JPG artefacts.

comment:3 by OptimusShepard, 4 years ago

Description: modified (diff)
Type: defectenhancement

comment:4 by Vladislav Belov, 4 years ago

Also you don't need the whole screenshot, since even the whole screenshot doesn't show all possible cases. You might use cropped image, like 512x512 or 256x256 to show more noticeable details.

in reply to:  4 comment:5 by OptimusShepard, 4 years ago

Replying to Vladislav Belov:

Also you don't need the whole screenshot, since even the whole screenshot doesn't show all possible cases. You might use cropped image, like 512x512 or 256x256 to show more noticeable details.

Ok, I will replace them. My current png are much to big.

by OptimusShepard, 4 years ago

Attachment: Non CAS.png added

No CAS

by OptimusShepard, 4 years ago

Attachment: 00 CAS.png added

0.0 CAS

by OptimusShepard, 4 years ago

Attachment: 03 CAS.png added

0.3 CAS

by OptimusShepard, 4 years ago

Attachment: 05 CAS.png added

0.5 CAS

by OptimusShepard, 4 years ago

Attachment: 10 CAS.png added

1.0 CAS

comment:6 by OptimusShepard, 4 years ago

Description: modified (diff)

comment:7 by nani, 4 years ago

How does it fare with FXAA enabled?
This should be very easy to add to 0ad but what about compatibility?
Looks very promising. Make diff and maybe we can add even add multiples sharpening filters :)

comment:8 by gameboy, 4 years ago

I saw in the shadow of your screenshot that the roof edge of the building is still serrated.

Do we need to add a second anti-aliasing feature: MSAA, thanks?

in reply to:  8 comment:9 by OptimusShepard, 4 years ago

Replying to gameboy:

I saw in the shadow of your screenshot that the roof edge of the building is still serrated.

I think you confuse it with the contour of the building. Take a closer look.

Do we need to add a second anti-aliasing feature: MSAA, thanks?

I think FXXA in combination with this sharpening pass leads to a good picture quality with less performance impact. A better antialiasing method would cost more performance and should be there for less priority.

in reply to:  7 comment:10 by OptimusShepard, 4 years ago

Replying to nani:

How does it fare with FXAA enabled?

The screenshots are taken with FXAA enabled. That’s why the picture without CAS is so blurry.

This should be very easy to add to 0ad but what about compatibility?

What do you mean with compatibility? Do you mean the licence? AMD allows you everything to do, you only must add the licence terms to the header (https://github.com/GPUOpen-Effects/FidelityFX/blob/master/LICENSE.txt).
If you mean the vendor compatibility, here is no problem. Btw these screenshots are taken on an Intel GPU.
As it works with Reshade OpenGl, I think it should work with 0 A.D. too?

Looks very promising. Make diff and maybe we can add even add multiples sharpening filters :)

I guess it should be easy to implement if you know what you are doing. But I have never did something like that bevor, so I don't know if I have the skill to do so :)

comment:11 by gameboy, 4 years ago

If you can do it, do it.

comment:12 by OptimusShepard, 4 years ago

Owner: set to OptimusShepard

comment:13 by Imarok, 3 years ago

Has this been fixed by Phab:rP23947?

in reply to:  13 comment:14 by Imarok, 3 years ago

Milestone: BacklogAlpha 24
Patch: Phab:D2642
Resolution: fixed
Status: newclosed

Replying to Imarok:

Has this been fixed by Phab:rP23947?

According to Phab:D2642 it seems like it has.

Note: See TracTickets for help on using tickets.