Gaussian Blur / Bloom / Unsharpmask
- Ioxa
- Topic Author
This shader is included in the CustomFX section of the Framework. The file available for download here is meant to be used with ReShade + SweetFX or ReShade + MasterEffect.
**Update for the ReShade + Framework version of the shade**
Updated 10/04/2015
I made some changes to the blur passes in this shader to reduce the performance cost, results that were taking 11 or more passes in the current version are now being achieved in 2 or 3 passes (3 or 4 passes for bloom). I'm still making some adjustments and looking for ways to reduce GaussianBlur and Unsharpmask to 2 passes max and GaussianBloom to 3 passes max but it may be awhile before I can work on it again so I figured I'd upload what I have.
Download Gaussian Perfromance Test
The GaussQuality and GaussBloomQuality settings now go from 0 to 3 instead of 0 to 12. Setting to 1 is equivalent to 3, 2 is equivalent to 9, and 3 is equivalent to 12.
Install instructions for Gaussian Blur / Bloom / Unsharpmask for use with SweetFX or MasterEffect.
1. Place the included ReShade.fx file in the same folder as SweetFX.fx or MasterEffect (ReShade.fx).
1.a) If using with MasterEffect, rename MasterEffects ReShade.fx file to ReShadeME.fx.
2. Place the included GAUSS_settings.h file in your SweetFX folder (if you don't have one, make one).
If using this with SweetFX, the definitions from GAUSS_settings.h may be cut and pasted into SweetFX_settings.txt.
If you do this, leave the last definitions in the GAUSS_settings.h file.
*Keeping the definitions in both files will cause errors.
3. Open GAUSS_settings.h and set "Compatibility" to 1 if using with SweetFX.
Set "Compatibility" to 2 if using with MasterEffect.
Leaving "Compatibility" set to 0 will only load the Gaussian effects.
Download
I know very very little about coding and only got this working with a lot of help from crosire, so if you find any problems or have any recomendations please let me know.
Please Log in or Create an account to join the conversation.
- kurtferro
Please Log in or Create an account to join the conversation.
- kurtferro
Please Log in or Create an account to join the conversation.
- crosire
Nah, it's ReShade, you don't need different shaders for D3D9 or D3D11 here . ReShade translates it all automaticly under the hood (it may be a good idea to remove that "_DX9" postfix to clarify that).kurtferro wrote: think need dx11 version
But there is problem with the shader, line 140 needs to be replaced by:
return tex2D(frameSampler, IN.UVCoord);
ALso, out of curiosity, why did you disable the brightpassfilter pass?
Please Log in or Create an account to join the conversation.
- TCPIP
#define sharp_strength 0.2
#define offset_bias 89.0
float4 LumaSharpenPass(float2 tex)
{
float4 blur_ori;
float4 ori = tex2D(s0, tex);
for(int j = -10; j <= 10; ++j)
{
for(int i = -10; i <= 10; ++i)
{
blur_ori += tex2D(s0, tex + float2((i * 0.1) * px,(j * 0.1) * py) * offset_bias);
}
}
blur_ori = blur_ori / 441;
float4 sharp = ori - blur_ori;
float4 sharp_mask = sharp * sharp_strength;
float4 done = ori + sharp_mask;
return done;
}
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
kurtferro wrote: Game client crash at start in neverwinter online, i think need dx11 version
I've used it with a couple DX11 games and haven't had any issues. I'll test it with some others to check for problems but I don't own Neverwinter so I can't try to reproduce your crash.
Thanks Crosire, I'll fix that. And it seemed like the brightpassfilter was making the final image much darker than it should be and overall lessening the effect. It was most noticeable when using blur, when I would increase GaussStrength the image would get darker. I never saw that happen when using it in Boulotaurs injector so not sure why it's happening now. I left it in there so I could mess with it some more but I was happy with the result when I disabled it.
TCPIP, I could try adding that in as an option. I am curious to see how the performance compares though, it looks like it does a lot of texture fetches to create the blurred image. Going by the line "blur_ori = blur_ori / 441;" I'm gonna guess roughly 441 texture fetches. It looks like it saves a lot of time when creating the sharpened image though. I'll see if I can get it working and try to compare the two.
Please Log in or Create an account to join the conversation.
- TCPIP
Please Log in or Create an account to join the conversation.
- kurtferro
i tryed too disabling all effect in sweetfx, but the result does not change
i try with TCPIP code now.
edit: if i paste TCPIP code i get errors in compiling
I do not have the necessary knowledge
there is some tutorials to understand something?
PS: Neverwinter online is free 2 play
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
Are you getting the same result when using it with other games?
The code that TCPIP posted might work as a custom shader in SweetFX, it won't work as is in a .fx file though.
In the meantime you can try using this one . I fixed the part Crosire pointed out. I've also added an option to use bloom along with blur or sharpening, still a work in progress but it's been working fine for me.
EDIT: Just tried Neverwinter and it crashed just like in your video. No clue what the problem may be but I'll see if I can figure it out.
Please Log in or Create an account to join the conversation.
- kurtferro
Please Log in or Create an account to join the conversation.
- K-putt
Please Log in or Create an account to join the conversation.
- TCPIP
www.mediafire.com/download/c2w7ij1xkfvw252/Shaders.zip
Please Log in or Create an account to join the conversation.
- kurtferro
this is only for blur?
Please Log in or Create an account to join the conversation.
- TCPIP
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
No problem! And I agree. I particularly like the bloom and hoping to eventually get the sigma, threshold, and exposure working, but I'm learning as I go so it may be awhile.K-putt wrote: This is great! Thanks for working on this. The gaussian shader/s are pretty essential if you ask me.
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
Still causing Neverwinter to crash which means there are probably other games that will have issues. If anyone has any ideas on how to fix this let me know.
Please Log in or Create an account to join the conversation.
- Wicked Sick
EDIT:
Just one question. Isn't there a way to turn this extra effect on and off, right?
Please Log in or Create an account to join the conversation.
- crosire
Easy, simply add "toggle = [KEYCODE];" right after "enabled = true;" in the technique line (which btw. would benefit from a nicer name, something like "technique GAUSS ...") and replace "[KEYCODE]" with the hexadecimal code of the desired key taken from here .Wicked Sick wrote: Just one question. Isn't there a way to turn this extra effect on and off, right?
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
Wicked Sick wrote: Thank you for this, Ioxa ^^
EDIT:
Just one question. Isn't there a way to turn this extra effect on and off, right?
No problem Wicked! Is there a specific effect you want to turn on and off or do you want to do what Crosire said and toggle everything in GAUSS on and off?
Also, thats a great idea Crosire, I'll add that in.
On a side note, I've been having some issues with this recently. I tried using it with DOF and it gave everything a red tint. I tried restarting the game and sometimes it would crash and other times it would keep running but with the red tint. Then I tried turning off DOF but the red tint remained. I even reinstalled ReShade + SweetFX, made sure that worked fine, then added GAUSS again, and I STILL got the red screen along with occasional crashing. Using that same GAUSS.fx file in another game worked just fine. I'm going through each effect one by one trying to find the problem but I can't figure out why the problem persisted after reinstalling everything and going back to a previously working configuration.
Please Log in or Create an account to join the conversation.
- crosire
OpenGL game + you are on NVIDIA, right? Cause then you ran into the NVIDIA driver bug I'm wrapping my head round for a while now already, switches the red and blue color channel under OpenGL in certain circumstances.Ioxa wrote: On a side note, I've been having some issues with this recently. I tried using it with DOF and it gave everything a red tint. I tried restarting the game and sometimes it would crash and other times it would keep running but with the red tint. Then I tried turning off DOF but the red tint remained. I even reinstalled ReShade + SweetFX, made sure that worked fine, then added GAUSS again, and I STILL got the red screen along with occasional crashing. Using that same GAUSS.fx file in another game worked just fine. I'm going through each effect one by one trying to find the problem but I can't figure out why the problem persisted after reinstalling everything and going back to a previously working configuration.
Please Log in or Create an account to join the conversation.