Welcome, Guest.
Username: Password: Remember me

TOPIC: Edge Smoothing

Edge Smoothing 5 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: 5 days 10 hours ago by Duran.te.
The administrator has disabled public write access.
The following user(s) said Thank You: BeTa, Viper_Joe

Soft Edges / Oversharp Fix 5 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: 5 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 5 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: 5 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 5 months 1 week 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 5 days 17 hours ago #5

Bump.

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