High Pass Sharpening / Contrast Enhancement

  • Ioxa
  • Topic Author
More
10 years 3 months ago #109 by Ioxa Replied by Ioxa on topic High Pass Sharpening / Contrast Enhancement
I'm still very new to coding so I feel more comfortable keeping this stuff separate in case I have to make some major changes. The gaussian shader is a port of Boulotaur2024's shader so most of the work for that was already done.

The Clarity shader is pretty simple though, I don't think there is much more I need to do to it. There are just a few more things I can think of that I'd like to change and maybe after that I'll see if they would want to add it to the Framework.
The following user(s) said Thank You: Tycholarfero, Encryption

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

  • DeMondo
More
10 years 2 months ago #110 by DeMondo Replied by DeMondo on topic High Pass Sharpening / Contrast Enhancement
ioFX v1.1 for ReShade + Framework is a great addition, thank you Ioxa!
The following user(s) said Thank You: Ioxa

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

  • Ioxa
  • Topic Author
More
10 years 2 months ago #111 by Ioxa Replied by Ioxa on topic High Pass Sharpening / Contrast Enhancement
Updated ioFX to version 1.2
Download ioFX v1.2 for ReShade + Framework

In this version I added a Bilateral filter and made a few more changes to the Clarity and High Pass Sharpening shaders.

The Bilateral filter can be used to blur without blurring across edges, this is similar to surface blurring. I'm also experimenting with using it for sharpening. The advantage of using a bilateral filter to sharpen is that it won't create halos around the edges of objects. On top of this I've also added a selective sharpening setting to limit the sharpening to highly textured areas, the idea behind this is to eliminate unwanted noise that may show up in areas such as sky textures that don't need to be sharpened.

For the Clarity and High Pass Sharpening shaders I added a setting for MaskContrast. Setting this to 0.00 uses linear interpolation to create the mask, this is what I've been using up till now. Setting it to 1.00 uses the Vivid Light blend mode to create the mask. Everything between 0.00 and 1.00 is a blend between the two.

I also removed the ClarityRadius setting and changed the way ClarityOffset works. As the offset gets larger the shader will increase the number of passes used, this seems to have a much lower performance cost than doing a single pass with a lot of texture fetches.

I still have a lot of ideas and things I want to work on but I'm not that motivated to work on it right now so I'm uploading what I've got. Let me know if you think any of the changes are bad or if I've broken anything and I'll try to make adjustments and improvements.
The following user(s) said Thank You: Wicked Sick, SiriusHours, Alex_outer, padolamap, SpinelessJelly, sajittarius, DeMondo, Golgotha, piltrafus, Rone and 3 other people also said thanks.

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

  • GlobalShader
More
10 years 2 months ago - 10 years 2 months ago #112 by GlobalShader Replied by GlobalShader on topic High Pass Sharpening / Contrast Enhancement

Ioxa wrote: Updated ioFX to version 1.2
Download ioFX v1.2 for ReShade + Framework

In this version I added a Bilateral filter and made a few more changes to the Clarity and High Pass Sharpening shaders.

The Bilateral filter can be used to blur without blurring across edges, this is similar to surface blurring. I'm also experimenting with using it for sharpening. The advantage of using a bilateral filter to sharpen is that it won't create halos around the edges of objects. On top of this I've also added a selective sharpening setting to limit the sharpening to highly textured areas, the idea behind this is to eliminate unwanted noise that may show up in areas such as sky textures that don't need to be sharpened.

For the Clarity and High Pass Sharpening shaders I added a setting for MaskContrast. Setting this to 0.00 uses linear interpolation to create the mask, this is what I've been using up till now. Setting it to 1.00 uses the Vivid Light blend mode to create the mask. Everything between 0.00 and 1.00 is a blend between the two.

I also removed the ClarityRadius setting and changed the way ClarityOffset works. As the offset gets larger the shader will increase the number of passes used, this seems to have a much lower performance cost than doing a single pass with a lot of texture fetches.

I still have a lot of ideas and things I want to work on but I'm not that motivated to work on it right now so I'm uploading what I've got. Let me know if you think any of the changes are bad or if I've broken anything and I'll try to make adjustments and improvements.


Could these shaders be merged to reshade repository?
Last edit: 10 years 2 months ago by GlobalShader.

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

  • Genrix
More
10 years 2 months ago #113 by Genrix Replied by Genrix on topic High Pass Sharpening / Contrast Enhancement
Ioxa,
You forgot a line #include EFFECT(ioFX, Util) in readme :)
The following user(s) said Thank You: Ioxa

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

  • padolamap
More
10 years 1 month ago #114 by padolamap Replied by padolamap on topic High Pass Sharpening / Contrast Enhancement
I'm having some flashes across the screen especially when used BilateralFilter are as asterisks or as the number sign, like a rain.

On the other hand all this part seems not to work, maybe this doing something wrong
#define CurveRed 0.00 //[-0.50:0.50] //-
#define CurveBlue 0.00 //[-0.50:0.50] //-
#define CurveGreen 0.00 //[-0.50:0.50] //-
Thanks

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

  • Ioxa
  • Topic Author
More
10 years 1 month ago #115 by Ioxa Replied by Ioxa on topic High Pass Sharpening / Contrast Enhancement

Genrix wrote: Ioxa,
You forgot a line #include EFFECT(ioFX, Util) in readme :)

Thanks, I'll have to fix that.

padolamap wrote: I'm having some flashes across the screen especially when used BilateralFilter are as asterisks or as the number sign, like a rain.

On the other hand all this part seems not to work, maybe this doing something wrong
#define CurveRed 0.00 //[-0.50:0.50] //-
#define CurveBlue 0.00 //[-0.50:0.50] //-
#define CurveGreen 0.00 //[-0.50:0.50] //-
Thanks

It could be caused by something in the blur passes, that's the only thing I can think of that would create that pattern. I haven't noticed anything like that though, so if you could post a screen shot and your settings I might be able to figure out what is causing it.

I forgot about those curve settings... I didn't update the color filter shader, they won't do anything.
The following user(s) said Thank You: padolamap

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

  • padolamap
More
10 years 1 month ago #116 by padolamap Replied by padolamap on topic High Pass Sharpening / Contrast Enhancement

they are like crosses and asterisks and are on the whole panatalla


////
//
///**HighPassSharpening**///
//
////
#define USE_HighPassSharpening 1 //[Sharp] //-Sharpens the image.

from already very grateful for your attention

//>Sharpening Settings<\\
#define SharpPrecision 4.0 //[0.4:5.0] //-#'s > 1 = smaller radius, #'s < 1 = bigger radius. A small radius will sharpen small details, a large radius will sharpen large details.
#define SharpRadius 2 //[0:2] //-0 = 3x3 mask, 1 = 5x5 mask, 2 = 7x7 mask.
#define MaskContrast 0.85 //[0.00:1.00] //-Increases the contrast in the SharpMask.
#define BlendMode 3 //[1|2|3|4|5|6|7] //-1 = Soft Light(weak), 2 = Overlay(neutral), 3 = Multiply, 4 = Hard Light, 5 = Vivid Light, 6 = Screen(strong) 7 = Linear Light
#define HPSharpStrength 1.50 //[-0.50:2.00] //-Strength of the sharpening effect. Negative values soften the image.

//>Advanced Sharpening Settings<\\
#define DarkLineIntensity 4.0 //[0.0:5.0] //-Adjust the strength of dark halos. If the dark halos are clamped, higher values may increase the radius but not the darkness.
#define LightLineIntensity 4.0 //[0.0:5.0] //-Adjust the strength of light halos. If the light halos are clamped, higher values may increase the radius but not the brightness.
#define DarkLineClamp 0.50 //[0.00:0.50] //-
#define LightLineClamp 0.50 //[0.00:0.50] //-
#define ViewSharpMask 0 //[0|1] //-Set to 1 to view the SharpMask. Helpful when adjusting settings.
#define HighPass_ToggleKey VK_INSERT //[undef] //-Default is the "Insert" key. Change to RFX_ToggleKey to toggle with the rest of the Framework shaders.


////
//
///**Clarity**///
//
////
#define USE_Clarity 1 //[Clarity] //-A local contrast enhancement technique that will emphasize objects in high contrast areas.

//>Clarity Settings<\\
#define ClarityOffset 15 //[1:20] //-Values less than 1 will decrease the radius, values greater than 1 will increase the radius.
#define ClarityMaskContrast 0.5 //[0.00:1.00] //-Increases the contrast in the ClarityMask.
#define ClarityBlendMode 3 //[1:7] //-1 = Soft Light(weak), 2 = Overlay(neutral), 3 = Multiply, 4 = Hard Light, 5 = Vivid Light, 6 = Soft Light#2(lighter), 7 = Soft Light#3(darker)
#define ClarityStrength 0.50 //[-0.50:2.00] //-Strength of the effect.

//>Advanced Clarity Settings<\\
#define DarkIntensity 5.0 //[0.0:5.0] //-Adjust the strength of dark halos.
#define LightIntensity 0.0 //[0.0:5.0] //-Adjust the strength of light halos.
#define DarkClamp 0.00 //[0.0:0.50] //-Adjust the strength of dark halos.
#define LightClamp 0.00 //[0.0:0.50] //-Adjust the strength of light halos.
#define ViewMask 0 //[0:1] //-The mask is what creates the effect. View it when making adjustments to get a better idea of how your changes will affect the image.
#define BlendIfDark 0 //[0:255] //-Any pixels below this value will be excluded from the effect. Set to 50 to target mid-tones.
#define BlendIfLight 255 //[0:255] //-Any pixels above this value will be excluded from the effect. Set to 205 to target mid-tones.
#define ViewBlendIfMask 0 //[0:1] //-Areas covered in RED receive contrast enhancement, areas covered in BLUE do not. The stronger the color, the stronger the effect.

//>Performance and Misc Settings<\\
#define ClarityTextureFormat 1 //[0|1|2] //-0 = R8, 1 = R16F, 2 = R32F.
#define ClarityTexScale 0 //[0|1|2] //-0 = no scaling, 1 = 1/2 resolution, 2 = 1/4 resolution. Reduces performance cost.
#define Clarity_ToggleKey VK_INSERT //[undef] //-Default is the "Insert" key. Change to RFX_ToggleKey to toggle with the rest of the Framework shaders.


////
//
///**BilateralFilter**///
//
////
#define USE_BilateralFilter 1 //[BilateralFilter] //-An edge-preserving smoothing filter. Can be used to reduce noise or sharpen without creating halos around strong edges.

//>Bilateral Settings<\\
#define SigmaEdge 0.90 //[0.01:1.00] //-The strength of the edges being preserved by the filter. Small values will preserve finer details.
#define BlurWidth 1 //[1:3] //-Higher values increase the blur radius but also increases the performance cost.
#define Iterations 1 //[1:3] //-Determines the number of blur passes the image goes through.
#define BilateralStrength 1.00 //[0.00:1.00] //-Overall strength of the effect.
#define BilateralFilterr_ToggleKey VK_INSERT //[undef] //-Default is the "Insert" key. Change to RFX_ToggleKey to toggle with the rest of the Framework shaders.

//>Detail Settings<\\
#define DetailStrength 1.90 //[0.00:2.00] //-Multiplier for the detail channel. 0.00 = No detail.
#define DetailCurveType 3 //[0:3] //-Curving the detail channel makes the image sharper, a stronger curve = a sharper image. 0 = no curve, 1 = smoothstep, 2 = smootherstep, 3 = smoothererstep.
#define Use_SelectiveSharpening 1 //[0:1] //-Applies sharpening to highly textured areas only. Increases the performance cost. Set to 0 if using the filter for blurring (DetailStrength = 0.00).
#define LowDetailCutoff 0.0001 //[0.00:0.25] //-Everything below this point is considered low detail and will not be sharpened.
#define HighDetailCutoff 0.90 //[0.05:1.00] //-Everything above this point is considered high detail and will be sharpened.
#define TextureMaskStrength 10.0 //[0.5:10.0] //-Adjusts the strength of textured areas.
#define ViewTextureMask 0 //[0:1] //-Texture mask used for SelectiveSharpening. Black areas are considered LowDetail, white areas are considered HighDetail. Helpful when adjusting DetailCutoffs and TextureMaskStrength.

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

  • piltrafus
More
10 years 1 month ago - 10 years 1 month ago #117 by piltrafus Replied by piltrafus on topic High Pass Sharpening / Contrast Enhancement

padolamap wrote: they are like crosses and asterisks and are on the whole panatalla


It seems like you finally burned yor GPU memory. Congrats. You are a man now ;)

Jokes aside if it looks similar to the pics in the link below your card may be gone. It may only happen in certain situations because the rest of the time you are not using the damaged area of the memory.
www.techsupportforum.com/forums/f24/vide...symptoms-651405.html
Last edit: 10 years 1 month ago by piltrafus.

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

  • padolamap
More
10 years 1 month ago #118 by padolamap Replied by padolamap on topic High Pass Sharpening / Contrast Enhancement
Hi, thanks for your answer, but I doubt that this is the problem because when I disable the function reshade stop doing it, plus the video card is new has no more than 5 months and is an AMD Asus Strix R9 fury.
thanks

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

  • Ioxa
  • Topic Author
More
10 years 1 month ago #119 by Ioxa Replied by Ioxa on topic High Pass Sharpening / Contrast Enhancement
I haven't been able to reproduce the problem but I see a few possible causes. The multiply blend mode is the original image * the sharp/clarity mask * 2.0, so the brighter parts of the image get a lot brighter. The detail strength in the bilateral filter is the detail channel * detail strength, since you have the setting at 1.90 the bright parts are again getting a lot brighter. My guess is that combining the multiply blend mode in high pass and clarity and then multiplying the detail by 1.90 is causing some issues. Try reducing the detail strength to 1.00 and try some of the other blend modes. If that doesn't get rid of it try enabling each effect one by one to see if you can narrow it down a single shader that is causing the problem.
The following user(s) said Thank You: padolamap

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

  • padolamap
More
10 years 1 month ago #120 by padolamap Replied by padolamap on topic High Pass Sharpening / Contrast Enhancement
thank you very much, you can fix by changing these values, thank you very much for your great work
The following user(s) said Thank You: Ioxa

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

  • Ioxa
  • Topic Author
More
10 years 1 month ago #121 by Ioxa Replied by Ioxa on topic High Pass Sharpening / Contrast Enhancement

padolamap wrote: thank you very much, you can fix by changing these values, thank you very much for your great work

Glad that worked. Thanks for letting me know. Did it seem like it was mostly the bilateral filter causing it?

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

  • Echo
More
10 years 1 month ago - 10 years 1 month ago #122 by Echo Replied by Echo on topic High Pass Sharpening / Contrast Enhancement
Hey loxa,

Have been following Reshade and your awesome ioFX almost from the start, but didn't have any questions or the necessity to ask anything, till the arrival of the New Reshade 2.0 and the absence of your ioFX in it, I had to ask if you're working on an update for Reshade 2.0?

I really hope you do, cause I can't use Reshade 2.0 without your awesome ioFX, (still using Reshade 1.1 and eagerly waiting for your update)

Thanks in advance!
Last edit: 10 years 1 month ago by Echo.

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

  • Ioxa
  • Topic Author
More
10 years 1 month ago #123 by Ioxa Replied by Ioxa on topic High Pass Sharpening / Contrast Enhancement

Echo wrote: Hey loxa,

Have been following Reshade and your awesome ioFX almost from the start, but didn't have any questions or the necessity to ask anything, till the arrival of the New Reshade 2.0 and the absence of your ioFX in it, I had to ask if you're working on an update for Reshade 2.0?

I really hope you do, cause I can't use Reshade 2.0 without your awesome ioFX, (still using Reshade 1.1 and eagerly waiting for your update)

Thanks in advance!

Yup, I'm working on porting the shaders to 2.0. I ran into a couple issues but I think I've got them solved, just waiting on clarification on something. Hopefully it won't be more than a day or two.
The following user(s) said Thank You: padolamap, Golgotha, Echo

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

  • Echo
More
10 years 1 month ago #124 by Echo Replied by Echo on topic High Pass Sharpening / Contrast Enhancement
Awesome! Do take your time. I am sure that am not the only one who's glad to know that you are working on an update.
Thank you again in advance!

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

  • Ioxa
  • Topic Author
More
10 years 4 weeks ago #125 by Ioxa Replied by Ioxa on topic High Pass Sharpening / Contrast Enhancement
Updated the shader files for compatibility with ReShade 2.0 and the new ReShade Assistant.
Download Shaders by Ioxa for ReShade 2.0

I made some small changes to some of the shaders but nothing major. The Clarity shader probably got the biggest change, I once again changed the options for adjusting the width of the effect. I think the way it is set up now gives the most customization for quality and performance. But I'm open to any ideas that may improve it.

I also uploaded a version of the shaders with an updated Gaussian shader. I'm not entirely sure I will keep it the way it is so consider this a test.
Download Shaders by Ioxa for ReShade 2.0 With Gauss

I changed the way the weights and offsets for the blur passes are calculated, this allows for a lot more flexibility when adjusting the blur width.

I added an option called SurfaceBlur which will help reduce halos that may appear around objects. This process used for doing this does not work very well in a separable filter so it causes some artifacts. As long as the blur strength isn't set too high they shouldn't be very noticeable.

I changed the "warm" option is GaussBloomWarmth. I'll never get it to look the way it did in SweetFX so I tried something a little different, I gave it a bit of a yellowish tint with a reddish tint around the edge. I don't know if I'll keep it this way or not, just something I wanted to try out.

I forgot to add a readme to the files but the install should be pretty straight forward. Merge the ReShade folder with your existing ReShade folder and overwrite the files when prompted. This will overwrite Pipeline.cfg, Shaders_by_Ioxa.cfg, Ioxa.undef, and Gaussian.fx if you've downloaded the files with Gauss.

If you have any questions, problems, or suggestions let me know!
The following user(s) said Thank You: Wicked Sick, padolamap, SpinelessJelly, amoebae, DeMondo, Golgotha, Qsimil, crubino, Echo, d-_-b

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

  • crosire
More
10 years 4 weeks ago #126 by crosire Replied by crosire on topic High Pass Sharpening / Contrast Enhancement
I suggest you add those to github.com/crosire/reshade-shaders

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

  • padolamap
More
10 years 4 weeks ago #127 by padolamap Replied by padolamap on topic High Pass Sharpening / Contrast Enhancement
many but thank you very much to you and extend to all other

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

  • Ioxa
  • Topic Author
More
10 years 4 weeks ago #128 by Ioxa Replied by Ioxa on topic High Pass Sharpening / Contrast Enhancement

crosire wrote: I suggest you add those to github.com/crosire/reshade-shaders

Ok, I'll add them. I want to clean them up a little first and see if anyone has any issues with the ones I posted here.

padolamap wrote: many but thank you very much to you and extend to all other

I think I fixed the cause of the problem you were running into with the bilateral filter. Try the shaders with the settings you were using before and let me know if it's still happening.
The following user(s) said Thank You: Echo

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

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.