Welcome, Guest.
Username: Password: Remember me

TOPIC: Edge Smoothing

Edge Smoothing 6 months 2 weeks ago #1

I was wondering if someone could make an edge softening shader, like a simple gaussian blur but filter limited to the edges.

I'm asking for this since I'm not a fan of rough edges. I prefer smooth ones as they give me a more cinematic feeling.
Not to mention all those games that uses too aggressive sharpening filters, causing ringing artifacts around the edges:



An example of ringing artifacts: Notice those white haloes around edges.
An edge smoothing shader would fix them.

Here's a simulation of the effect I'd like to achieve, made with photoshop.

I applied gaussian blur to the whole image and then I made a mask using with the photoshop's "find edges" filter, so that the textures (especially the snow and the threes, in this case) are not affected by the blurriness.

Also, the subtle ringing artifact is fixed.



Original Shot




Edge Smoothing




Edge Mask

I know that Reshade's FXAA filter could be a solution, but the problem is that it messes with already anti-aliased images:
(In-game TAA is on)

Last Edit: 1 month 1 week ago by Duran.te.
The administrator has disabled public write access.
The following user(s) said Thank You: BeTa, acknowledge, Viper_Joe, Dom324

Soft Edges / Oversharp Fix 6 months 2 weeks ago #2

Well, funnily I've just implemented a way to reduce halos in my sharpening shader. It's nothing sophisticated, but I'm quite satified with the results. Basically I'm just adding sharpness depending on pixel brightness, thus reducing edges in high-contrast areas (like skies).

Here's a comparison (left: original, middle: less sharpness for bright pixels, right: standard sharpness)


Of course due to the uneven sharpening some details can look slightly odd (text etc.), but imo it can achive better results than by just clamping the unsharp mask.
Maybe I will post the code here soon. Although it may lack context, here is the important line:
fine *= (1-saturate(pow(abs(color.xyz), 1 / (fSharpen_DynamicCurve + 0.001))));
Last Edit: 6 months 2 weeks ago by brussell.
The administrator has disabled public write access.
The following user(s) said Thank You: BeTa, Viper_Joe, Duran.te

Soft Edges / Oversharp Fix 6 months 2 weeks ago #3

Check out this topic reshade.me/forum/shader-presentation/395...n?limitstart=0#26156

Created sharpening filter that addresses just that issue using depth high-pass mask and it's already in default repository under FilmicAnamorphSharpen.fx



Depth pass is required for it to work, but you can also try using "Sharpen clamping" setting without depth pass to reduce halos.
If you're looking for more performance-wise version without depth masking, visit my Shaders repository (link under my profile information at the bootom of this post), look for FilmicSharpen.fx
Last Edit: 6 months 2 weeks ago by Fu-Bama.
The administrator has disabled public write access.
The following user(s) said Thank You: Duran.te

Soft Edges / Oversharp Fix 6 months 2 weeks ago #4

This certainly solves the first problem. However, as I mentioned above, there's nothing to do with already - oversharpened images, in that case an edge softener shader would help a lot.
The administrator has disabled public write access.

Edge Smoothing 1 month 1 week ago #5

Bump.

Topic updated, added reference shots.
Could someone help this case?
The administrator has disabled public write access.

Edge Smoothing 3 weeks 6 days ago #6

You can try using gaussain blur shader or NFAA.fx from this shader pack. Could work in a few cases. I'm unable to give you any better solution here.
Last Edit: 3 weeks 6 days ago by jas01. Reason: ...
The administrator has disabled public write access.

Edge Smoothing 3 weeks 3 days ago #7

Unfortunately, since NFAA is an antialiasing shader, it causes some artifacts with in-game antialiasing on (as you can see in the last screen I posted).
It would also be nice if values like intensity and radius could be controlled with dedicated sliders, rather than just the threshold one.
Thanks for help, anyway. :)
The administrator has disabled public write access.
The following user(s) said Thank You: jas01

Edge Smoothing 3 weeks 3 days ago #8

A lot of modern games have a sharpening effect enabled. Try look for sharpening settings in the game's ini files.
Last Edit: 3 weeks 3 days ago by Insomnia.
The administrator has disabled public write access.

Edge Smoothing 3 weeks 5 hours ago #9

Your screenshots look truly great (except that blur and slightly altered colors on the backpack), I can imagine number of games where this could be used.
The administrator has disabled public write access.

Edge Smoothing 2 weeks 5 days ago #10

Combination of Texture LOD -0.250(driver controlled LOD is off), AMD Sharpening filter (i used a version ported to Reshade) and NFAA is working really well for me
oh and i use Deband to smooth out some of those banding problems, you can see it really well in the skies in some games
Last Edit: 2 weeks 5 days ago by S3r1ous.
The administrator has disabled public write access.