Gaussian Blur / Bloom / Unsharpmask
- K-putt
Also, there is no way to disable the shader completely anymore. Except the Toggle.
There used to be "#define USE_GAUSS 1". Not sure if that actually worked though.
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
K-putt wrote: Could you write the shader so that it's tweakable via SweetFX's settings.txt?
Also, there is no way to disable the shader completely anymore. Except the Toggle.
There used to be "#define USE_GAUSS 1". Not sure if that actually worked though.
I could... but it would require packaging this with a custom SweetFX_settings.txt. I was thinking of making a .txt for all these settings. I could make it so it would be easy to cut and paste them into SweetFX_settings.txt and as long as GAUSS.fx was hooked into SweetFX after the settings section it will use all the definitions in there (at least I think it will, haven't actually tried it). I'm gonna try to re-write this over the weekend and get rid of some stuff (basically my attempts to make up for the parts I can't figure out), when I do that I'll take all the definitions out of the .fx file and put em in a .txt file.
That USE_GAUSS setting was in the one I combined with SweetFX.fx. It worked, it just kept the file from using any of the GAUSS passes. When I move the definitions to the .txt. file I'll put it back in.
Please Log in or Create an account to join the conversation.
- Wicked Sick
i.imgur.com/y718FBd.jpg
I have renamed the file to just "gauss.fx"
i.imgur.com/LkRsF4G.png
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
/*----------------------.
| :: Vertex Shader :: |
'----------------------*/
void FullscreenTriangle(in uint id : SV_VertexID, out float4 position : SV_Position, out float2 texcoord : TEXCOORD0)
{
// Basic Buffer/Layout-less fullscreen triangle vertex shader - used for several of the passes.
texcoord.x = (id == 2) ? 2.0 : 0.0;
texcoord.y = (id == 1) ? 2.0 : 0.0;
position = float4(texcoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0);
}
#include"GAUSS4SweetFX.fx"
/*-----------------------.
| :: Cartoon :: |
'-----------------------*/
#if (USE_CARTOON == 1)
// Cartoon
#include "SweetFX\Shaders\Cartoon.h"
#include "SweetFX\Shaders\CartoonWrap.h"
#endif
Or you can just put the #include line at the very bottom of the file, only difference is it will run after SweetFX instead of before it. Just make sure whatever is in quotes matches the file name.
Hopefully that will clear up the other error too, otherwise I may have made a typo.
Please Log in or Create an account to join the conversation.
- Wicked Sick
EDIT:
Effect 6 reminds me of this!!!
www.emuparadise.me/fup/up/52771-Silent_Hill_(E)-1.jpg
XDDD
EDIT 2:
>//No Bloom for now.
Made me die a bit inside xD
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
I've been working on the contrast enhancement quite a bit and I think I've got it set pretty neutral now. The Lift setting in the one I uploaded may be a little low so if the shadows are too dark try raising it a bit, maybe around 0.600 for all three.
Haha, sorry about that, I gutted bloom to make the contrast mask. AddBloom might still work... I didn't really test it though. I've got bloom working again now though, I should have the updated files ready this weekend.
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
The stand-alone GAUSS.fx seems to be much more stable now, may have been a problem with where the #include line was being placed. I changed the install instructions and bundled them with the download. Also updated the others in case there are still issues with this.
Moved the settings from the .fx file to a text file. Also cleaned them up a bit, a little easier to adjust now.
Still trying to figure out how the rest of the settings from the original worked (GaussSigma, GaussQuality, etc), if anyone has any ideas let me know.
Please Log in or Create an account to join the conversation.
- JPulowski
When I was fiddling with the code I also saw those variables. I think those variables might be somehow hardcoded into the injector itself. It is better to ask Boulotaur2024, since he is the original author of the shader.Ioxa wrote: Still trying to figure out how the rest of the settings from the original worked (GaussSigma, GaussQuality, etc), if anyone has any ideas let me know.
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
JPulowski wrote: When I was fiddling with the code I also saw those variables. I think those variables might be somehow hardcoded into the injector itself. It is better to ask Boulotaur2024, since he is the original author of the shader.
I think you're right about them being hardcoded, looking through the dx9 and the dx11 files I don't see them mentioned anywhere. Do you know how I could contact Boultaur?
Please Log in or Create an account to join the conversation.
- crosire
GaussQuality:
Sets the amount of blurring iterations (how often the horizontal and vertical blurring pass is repeated). It's pretty much what you already implemented via GaussRadius. Values:
- 0 => 1 iteration, Low
- 1 => 3 iterations, Medium
- 2 => 9 iterations, High
- 3 => 12 iterations, Ultra
- 4 => 96 iterations, OverKill
Affects scaling of the affect. Basically changes the rendertarget sizes. This is what he does in C++ code translated to equivalent ReShade shader code.
#if GaussEffect == 3 // Bloom
#define GAUSS_WIDTH exp2(ceil(log2(BUFFER_WIDTH / max(1.0, GaussSigma * 4))))
#define GAUSS_HEIGHT exp2(ceil(log2(BUFFER_HEIGHT / max(1.0, GaussSigma * 4))))
#define PIXEL_SIZE float2(1.0 / GAUSS_WIDTH, 1.0 / GAUSS_HEIGHT)
#elif GaussEffect == 2 // Sharpen
#define GAUSS_WIDTH BUFFER_WIDTH
#define GAUSS_HEIGHT BUFFER_HEIGHT
#define PIXEL_SIZE float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT)
#else // Blur
#define GAUSS_WIDTH exp2(ceil(log2(BUFFER_WIDTH / max(1.0, GaussSigma))))
#define GAUSS_HEIGHT exp2(ceil(log2(BUFFER_HEIGHT / max(1.0, GaussSigma))))
#define PIXEL_SIZE float2(1.0 / GAUSS_WIDTH, 1.0 / GAUSS_HEIGHT)
#endif
...
texture HblurTex2D { Width = GAUSS_WIDTH; Height = GAUSS_HEIGHT; Format = R8G8B8A8; };
texture VblurTex2D { Width = GAUSS_WIDTH; Height = GAUSS_HEIGHT; Format = R8G8B8A8; };
Please Log in or Create an account to join the conversation.
- Sh1nRa358
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
EDIT: Am I reading the code right? is it basically saying GAUSS_WIDTH is equal to 2^logbase-2(BUFFER_WIDTH / GaussSigma * 4)?
I'm getting an error that says CreateTexture2D failed with -2147024809!
So I simplified the math down to BUFFER_WIDTH/GaussSigma * 4 and that works but it won't return a 1 when GaussSigma = 0. I tried using just the max function but that threw up the same error. I guess as long as I'm reading the math right I should be able to figure out a way to do it.
@Sh1nRa358 I think that glow comes from the Bloom Intensity setting I added as an attempt to replace the bloom exposure from the original. I removed it because it just wasnt the same. But even with that back in the color is still off... You're probably better off using the one I uploaded for you for now until I can figure out why they look so different.
Please Log in or Create an account to join the conversation.
- Wicked Sick
EDIT:
oh, never mind, you already did xD
EDIT 2:
Ioxa, have you tried gauss with the preview 7?
forums.guru3d.com/showpost.php?p=5025393&postcount=542
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
Yeah, i was using it with preview 7, I didn't run into any issues, did you? The install instructions will need to be updated but as long as you place the #include line below the vertex shader it should be fine.
Really I don't see why the location of the #include line should affect anything accept for when GAUSS.fx runs but for some reason placing it at the bottom of the file was causing crashes with SweetFX, it worked fine with ME though. When I get a chance I'll test it again with preview 7 and see if it still crashes.
Also, I noticed my video cards getting pegged at 99% a few times while using this, alt-tabbing out of the game a couple times fixed it.
Please Log in or Create an account to join the conversation.
- Wicked Sick
i.imgur.com/Uitv7Qa.png
I am using the ReSahde 0.15.0.716.
I feel dumb, I can't see what I have done wrong. I also haven't noticed the VGA usage while playing with gauss. Will have to check, but the game play was normal so far.
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
Does SweetFX work when GAUSS.fx is hooked to it? You could try cutting the settings out of the GAUSS_settings.txt and pasting them into SweetFX_settings.txt that way it will update changes on the fly. The new version of ReShade will only look for changes to SweetFX_settings.txt before it recompiles. Just make sure GAUSS_settings.txt is empty, deleted, or renamed otherwise you'll get errors from the definitions being in both files.
Please Log in or Create an account to join the conversation.
- Wicked Sick
SFX loads ok after following the instruction steps. I will try doing that you said now.
EDIT:
Pasting the stuff after the Custom Settings section didn't work.
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
You could try renaming GAUSS.fx to ReShade.fx just to see if it at least works. You could also try moving the #include line to the very bottom of SweetFX.fx to see if it causes the game to crash, then you will know it's seeing the include line. I don't own Witcher 2 so I can't do any testing of my own.
Please Log in or Create an account to join the conversation.
- Wicked Sick
Effect 4 has changed? Isn't like Silent Hill 1 cd cover anymore? xD It blurs all the screen: i.imgur.com/cM34JJf.png
And effect 1 gave me this error: i.imgur.com/o0EvjrY.png
I have changed only which effect to be used, not any of their values.
Tried the same stuff with the Witcher, that Worked with Sleeping Dogs, only change the dll, of course, but the same thing as before.
Please Log in or Create an account to join the conversation.
- Ioxa
- Topic Author
Maybe the problem is with 32bit games, I'll have to test that out. Did GAUSS.fx work with Witcher 2 when renaming it to ReShade.fx? If that works you can try adding SweetFX to that and running both that way. It would look something like this,
#include "Sweet.fx"
#include "SweetFX/GAUSS_settings.txt" //load Gaussian Blur settings
#if USE_GAUSS == 1
Please Log in or Create an account to join the conversation.