New Luma Sharpen

  • Posts: 162
2 years 6 months ago #1 by Fu-Bama
Hello,
I would like to share with you new version of Luma Sharpen filter. It produces less aliasing artifacts with better performance.

Here's original filter sharpen layer:


And here's mine:



Some pics from Alien: Isolation
Before:


and After:



Before:


After:


Shader code:
Warning: Spoiler! [ Click to expand ]
The following user(s) said Thank You: crosire, Wicked Sick, BeTa, Alex_outer, kaicooper, Scorpio82CO, jmx777, DeMondo, Qsimil, andrew and 19 other people also said thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 20
2 years 6 months ago - 2 years 6 months ago #2 by SandyCheeks
That second debug screenshot is beautiful. I'm curious, is your new luma shader also implementing a form of anti-aliasing and then sharpening? Or is the lack of aliasing in your version a result of some genius shader writing :) ?

I guess what i'm really asking is, would we get the same(ish) results by using a form of anti aliasing followed by the old version of lumasharpen as we would by just using your shader by itself?

Please Log in or Create an account to join the conversation.

  • Posts: 455
2 years 6 months ago #3 by Martigen
This looks excellent, thank you! Will give it a go.

Please Log in or Create an account to join the conversation.

  • Posts: 1221
2 years 6 months ago #4 by Marty McFly

SandyCheeks wrote: That second debug screenshot is beautiful. I'm curious, is your new luma shader also implementing a form of anti-aliasing and then sharpening? Or is the lack of aliasing in your version a result of some genius shader writing :) ?

I guess what i'm really asking is, would we get the same(ish) results by using a form of anti aliasing followed by the old version of lumasharpen as we would by just using your shader by itself?


He's using a different blur kernel than original luma sharpen.
The following user(s) said Thank You: SandyCheeks

Please Log in or Create an account to join the conversation.

  • Posts: 272
2 years 6 months ago #5 by robgrab
I tried it last night and now it's my new default luma sharpen. Great work!

Please Log in or Create an account to join the conversation.

  • Posts: 162
2 years 6 months ago - 2 years 6 months ago #6 by Fu-Bama

SandyCheeks wrote: That second debug screenshot is beautiful. I'm curious, is your new luma shader also implementing a form of anti-aliasing and then sharpening? Or is the lack of aliasing in your version a result of some genius shader writing :) ?

I guess what i'm really asking is, would we get the same(ish) results by using a form of anti aliasing followed by the old version of lumasharpen as we would by just using your shader by itself?

Thank you ;)
There's no anti-aliasing implemented in this shader, just approach to high-pass filter, or blur as Marty McFly noted, is different.
You won't get the same result with the old version as it implements it's own aliasing even to anti-aliased source. As seen on debug example.
The following user(s) said Thank You: SandyCheeks

Please Log in or Create an account to join the conversation.

  • Posts: 162
2 years 6 months ago #7 by Fu-Bama

robgrab wrote: I tried it last night and now it's my new default luma sharpen. Great work!

Thank you. :cheer:
Maybe it should replace the default Luma Sharpen in Reshade-shaders?
What do you think? I can create pull request.
The following user(s) said Thank You: WalterDasTrevas

Please Log in or Create an account to join the conversation.

  • Posts: 7
2 years 6 months ago #8 by bacondither
This shader is essentially the same as lumasharpen, except using overlay blending for the result and setting the "sharp_clamp" to such a large value it does not really do much anymore. The speed seems to be identical to lumasharpen for me.

Have fun experimenting :)

Please Log in or Create an account to join the conversation.

  • Posts: 221
2 years 6 months ago #9 by Sunesha
I tried this shader out for a couple days with Fallout 4. Really like the results and how it looks. Definitely a LumaSharpen alternative.

I used it with Fallout 4 with TAA(Blurry but a very calm picture in motion) and this settings was decent:
Sharpen: 2,400
BT709
Clamp: 0,600
Highpass:1

I gonna check out later how it looks with a game with SMAA which has a lot more creepy crawly pixels in another game. But this sharpener is very subtle and nice.

But I can see how I will use this instead of the LumaSharpen in most cases. Though I like to use LumaSharpen with a low offset bias setting and high sharpen setting. If there was depth-based sharpen tool I would love that. I use selective sharpening in photowork in similar way. And depth based control sharpen would be super awesome. But not sure how it would look in a game.

Thank you, it is a vert nice sharpener on its own. More alternatives is never a bad thing

Please Log in or Create an account to join the conversation.

  • Posts: 261
2 years 6 months ago #10 by Kleio420
what about making two modes for it one just depth based and then a third mode using depth to compare to the original pass to help only sharpen what you want more specifically then just a broad range offered atm?
The following user(s) said Thank You: jas01

Please Log in or Create an account to join the conversation.

  • Posts: 162
2 years 6 months ago - 2 years 6 months ago #11 by Fu-Bama

Kleio420 wrote: what about making two modes for it one just depth based and then a third mode using depth to compare to the original pass to help only sharpen what you want more specifically then just a broad range offered atm?

What do you mean by depth-driven sharpen? Should it leave smooth transitions between foreground-background objects edges, like Panavision lenses vimeo.com/167050590 and sharpen only foreground/background-planes content? Or sharpen foreground and leave background untouched?
I can experiment with both. I just want to know what you imagine the depth-driven sharpening would do.

Please Log in or Create an account to join the conversation.

  • Posts: 261
2 years 6 months ago #12 by Kleio420

Fu-Bama wrote:

Kleio420 wrote: what about making two modes for it one just depth based and then a third mode using depth to compare to the original pass to help only sharpen what you want more specifically then just a broad range offered atm?

What do you mean by depth-driven sharpen? Should it leave smooth transitions between foreground-background objects edges, like Panavision lenses vimeo.com/167050590 and sharpen only foreground/background-planes content? Or sharpen foreground and leave background untouched?
I can experiment with both. I just want to know what you imagine the depth-driven sharpening would do.

similar to the edited version of luma sharpen that was made for enb usage was thinking you could use depth as a way to lower the radius of whats sharpened rather then what appears to be applied to the entire image?

Please Log in or Create an account to join the conversation.

  • Posts: 221
2 years 6 months ago #13 by Sunesha
My idea of a depth--based sharpener. I show instead of tell with help of photoshop and a video. A bit long (5min) :whistle:

The following user(s) said Thank You: Kleio420, jas01, Fu-Bama

Please Log in or Create an account to join the conversation.

  • Posts: 261
2 years 5 months ago #14 by Kleio420

Sunesha wrote: My idea of a depth--based sharpener. I show instead of tell with help of photoshop and a video. A bit long (5min) :whistle:

if a sharpen shader for reshade were to work more like that it would be great

Please Log in or Create an account to join the conversation.

  • Posts: 162
2 years 5 months ago #15 by Fu-Bama

Sunesha wrote: My idea of a depth--based sharpener. I show instead of tell with help of photoshop and a video. A bit long (5min) :whistle:
https://youtu.be/o7vMpI7PwUU


Ok, I added depth mask to the shader. :)
By default it's set to preview mode for the sharpening start and stop.

Shader Code:
Warning: Spoiler! [ Click to expand ]
The following user(s) said Thank You: Kleio420, Scorpio82CO, DeMondo, Ryukou36, Sunesha, Marty, Rudy102, someone_for

Please Log in or Create an account to join the conversation.

  • Posts: 162
2 years 5 months ago - 2 years 5 months ago #16 by Fu-Bama
I also made Panavison-like sharpen version that has Depth high-pass mask.
It gives some interesting results

Images:
Warning: Spoiler! [ Click to expand ]

Shader Code:
Warning: Spoiler! [ Click to expand ]
The following user(s) said Thank You: Scorpio82CO, Ryukou36, Marty, Rudy102, someone_for

Please Log in or Create an account to join the conversation.

  • Posts: 127
2 years 5 months ago #17 by Chavolatra
it is last version ?

Please Log in or Create an account to join the conversation.

  • Posts: 162
2 years 5 months ago - 2 years 5 months ago #18 by Fu-Bama

Chavolatra wrote: it is last version ?

Panavision one and one with depth mask are two different sharpen effects. But I would suggest to use the Panavison one, since it solves the problem that Sunesha mentioned in the video in a more automatic way.

Please Log in or Create an account to join the conversation.

  • Posts: 18
2 years 5 months ago #19 by Zarathustra
Great work. More filters are always good.

When I used it for Civ 6, I noticed that it accentuates white edges more than the default LumaSharpen filter, which I prefer in that case.

The accentuated bright edges are maybe something to look out for and I guess it depends primarily on the use case and personal preference which filter to use.
The following user(s) said Thank You: Fu-Bama

Please Log in or Create an account to join the conversation.

  • Posts: 90
2 years 5 months ago #20 by Scorpio82CO
gives beautiful results in image quality, tremendous!!
The following user(s) said Thank You: Fu-Bama

Please Log in or Create an account to join the conversation.