Opened 5 months ago

Last modified 5 months ago

#5677 new enhancement

Sharpening Pass

Reported by: OptimusShepard Owned by: OptimusShepard
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords:
Cc: Patch:

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 5 months ago.
No CAS
00 CAS.jpg (759.9 KB) - added by OptimusShepard 5 months ago.
0.0 CAS
03 CAS.jpg (791.3 KB) - added by OptimusShepard 5 months ago.
0.3 CAS
05 CAS.jpg (815.0 KB) - added by OptimusShepard 5 months ago.
0.5 CAS
10 CAS.jpg (943.9 KB) - added by OptimusShepard 5 months ago.
1.0 CAS
Non CAS.png (801.5 KB) - added by OptimusShepard 5 months ago.
No CAS
00 CAS.png (877.9 KB) - added by OptimusShepard 5 months ago.
0.0 CAS
03 CAS.png (957.8 KB) - added by OptimusShepard 5 months ago.
0.3 CAS
05 CAS.png (984.6 KB) - added by OptimusShepard 5 months ago.
0.5 CAS
10 CAS.png (1.0 MB) - added by OptimusShepard 5 months ago.
1.0 CAS

Change History (22)

Changed 5 months ago by OptimusShepard

Attachment: Non CAS.jpg added

No CAS

Changed 5 months ago by OptimusShepard

Attachment: 00 CAS.jpg added

0.0 CAS

Changed 5 months ago by OptimusShepard

Attachment: 03 CAS.jpg added

0.3 CAS

Changed 5 months ago by OptimusShepard

Attachment: 05 CAS.jpg added

0.5 CAS

Changed 5 months ago by OptimusShepard

Attachment: 10 CAS.jpg added

1.0 CAS

comment:1 Changed 5 months ago by OptimusShepard

Description: modified (diff)

comment:2 Changed 5 months ago by Vladislav Belov

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 Changed 5 months ago by OptimusShepard

Description: modified (diff)
Type: defectenhancement

comment:4 Changed 5 months ago by 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.

comment:5 in reply to:  4 Changed 5 months ago by OptimusShepard

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.

Changed 5 months ago by OptimusShepard

Attachment: Non CAS.png added

No CAS

Changed 5 months ago by OptimusShepard

Attachment: 00 CAS.png added

0.0 CAS

Changed 5 months ago by OptimusShepard

Attachment: 03 CAS.png added

0.3 CAS

Changed 5 months ago by OptimusShepard

Attachment: 05 CAS.png added

0.5 CAS

Changed 5 months ago by OptimusShepard

Attachment: 10 CAS.png added

1.0 CAS

comment:6 Changed 5 months ago by OptimusShepard

Description: modified (diff)

comment:7 Changed 5 months ago by nani

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 Changed 5 months ago by gameboy

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?

comment:9 in reply to:  8 Changed 5 months ago by OptimusShepard

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.

comment:10 in reply to:  7 Changed 5 months ago by OptimusShepard

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 Changed 5 months ago by gameboy

If you can do it, do it.

comment:12 Changed 5 months ago by OptimusShepard

Owner: set to OptimusShepard
Note: See TracTickets for help on using tickets.