The Gaussian effect

  • Wicked Sick
  • Topic Author
More
9 years 3 months ago #1 by Wicked Sick The Gaussian effect was created by Wicked Sick
Crosaire said to be working on the next version of the beta, which is great. I feel bad for asking this, but there is a chance to see the Gausian effect from the old one here? I liked the blur option for some reason...

"#define USE_GAUSSIAN 1 // [0 or 1] Gaussian Blur : can be used to... blur, but also bloom/hazy/glowy look, also unsharp masking."

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

  • Ioxa
More
9 years 3 months ago #2 by Ioxa Replied by Ioxa on topic The Gaussian effect
I've been trying to get this to work with ReShade but after fixing one error I got another that I have no idea how to fix.

I took the GAUSS_DX11.fx file from Boulotaur's injector and put it in the same folder as Sweet.fx. I then added a line in the globals section in Sweet.fx to include GAUSS_DX11.fx. I took the settings from the old SweetFX_settings.txt and defined them in GAUSS_DX11.fx. At this point I tried running it and got an error about coefLuma already being defined so I changed its name in GAUSS_DX11.fx.

Now I'm getting this error,
"GAUSS_DX11.fx(46, 1): error X3000: syntax error, unexpected identifier, expecting end of file

compilation failed with 1 errors."

And this is where I'm stuck...

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

  • crosire
More
9 years 3 months ago - 9 years 3 months ago #3 by crosire Replied by crosire on topic The Gaussian effect

Ioxa wrote: I took the GAUSS_DX11.fx file from Boulotaur's injector and put it in the same folder as Sweet.fx.

Tip: Try to start with GAUSS_DX9.fx instead, ReShade's shading language is a lot more similar to Direct3D9 HLSL (shadermodel 3 that is).

Then try this:
  1. Replace "texture2D frameTex2D;" with
    texture2D frameTex2D : COLOR;
  2. Replace "texture2D origframeTex2D;" with
    texture2D origframeTex2D
    {
    	Width = BUFFER_WIDTH;
    	Height = BUFFER_HEIGHT;
    ];
  3. Remove the "<" and ">" from the sampler property lists.
  4. Replace the FrameVS function with the following:
    VSOUT FrameVS(in uint id : VERTEXID)
    {
    	VSOUT OUT;
    	OUT.UVCoord = float2((id == 2) ? 2.0 : 0.0, (id == 1) ? 2.0 : 0.0);
    	OUT.vertPos = float4(OUT.UVCoord * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0);
    	return OUT;
    }
  5. Add a new function before the technique:
    float4 PassThrough(VSOUT IN) : COLOR
    {
    	return tex2D(frameTex2D, IN.UVCoord);
    }
  6. Before "pass P0" add another pass like this:
    pass
    {
    	VertexShader = FrameVS;
    	PixelShader = PassThrough;
    	RenderTarget = origframeTex2D;
    }
  7. Remove all "compile vs_3_0" and "compile ps_3_0" references and the brackets in the pass bodies. You can also remove the "AlphaBlendEnable" and "SRGBWriteEnable" states if you want, ReShade's default values match them.
  8. Don't forget to modify the technique so it is rendered by ReShade:
    technique t0 < enabled = true; > { ... }

Should do the job unless I missed something. Or at least it should be a good starting point.
Last edit: 9 years 3 months ago by crosire.
The following user(s) said Thank You: Ioxa

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

  • Wicked Sick
  • Topic Author
More
9 years 3 months ago - 9 years 3 months ago #4 by Wicked Sick Replied by Wicked Sick on topic The Gaussian effect
We were stuck at the same place, loxa. Thanks, Crosaire.

EDIT:

I am trying but I have noticed something. A pattern. Stuff begins with a { and ends with a } but step 2 is ending with a ]. Is that right?
Last edit: 9 years 3 months ago by Wicked Sick.

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

  • Ioxa
More
9 years 3 months ago #5 by Ioxa Replied by Ioxa on topic The Gaussian effect
Thats just a typo Wicked, its an easy one to make.

So there was a problem with the two arrays at the very top, something about the initial value having to be a literal expression. Again I had no idea what the problem was so I just moved them into the methods they were being used in. From the searches I made it seemed like there was some problem with global static variables so I made them local... I think I'm using the right terminology.

So those don't seem to be causing any issues anymore, but now I'm getting issues with PIXEL_SIZE.x and PIXEL_SIZE.y.

It says they are uninitialized but they were never initialized in the original code so I don't know where it was pulling those from or what I can replace them with.

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

  • TCPIP
More
9 years 3 months ago #6 by TCPIP Replied by TCPIP on topic The Gaussian effect
Boulotaur had a lot of stuff for Gaussian shader in the dll itself, which is unfortunate for us...

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

  • Ioxa
More
9 years 3 months ago #7 by Ioxa Replied by Ioxa on topic The Gaussian effect

TCPIP wrote: Boulotaur had a lot of stuff for Gaussian shader in the dll itself, which is unfortunate for us...

Hmm, maybe it would be easier to just make a new one.

I think I fixed the PIXEL_SIZE problem but of course that led to another error. Or maybe my "fix" caused the error. What I did was replace PIXEL_SIZE with PIXEL_X and PIXEL_Y then defined those as BUFFER_RCP_WIDTH and BUFFER_RCP_HEIGHT. I don't know what those are, I just saw them used in another shader and thought they might work.

But now I'm getting this error...
Shader@0x0C9C18D0(38,16): error X3017: '__tex2D': cannot implicitly convert from 'const Texture2D' to 'struct __sampler2D'

The numbers after Shader@ change each time so I'm guessing it's pointing to a memory location?

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

  • crosire
More
9 years 3 months ago - 9 years 3 months ago #8 by crosire Replied by crosire on topic The Gaussian effect
PIXEL_SIZE is what it says, the size of one pixel on your screen, which happens to be the reciprocal of the resolution, so you got that right.
#define PIXEL_SIZE float2(BUFFER_RCP_WIDTH, BUFFER_RCP_HEIGHT)

The "tex2D" intrinsic requires a sampler as parameter, no texture: I made a mistake there, you actually have to write "tex2D(frameSampler, IN.UVCoord)" and not "tex2D(frameTex2D, IN.UVCoord)".
The "Shader@XXXXXXXXX" errors are internal compiler errors and normally should not happen. I'm surprised this one appeared, was expecting a different error... But ok.
Last edit: 9 years 3 months ago by crosire.
The following user(s) said Thank You: Ioxa

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

  • kurtferro
More
9 years 3 months ago #9 by kurtferro Replied by kurtferro on topic The Gaussian effect
Among the added effects of Boulotaur my favorite is unsharperd mask, unfortunately I do not have the knowledge to be able to make it, I just realized that in the file .fx it's not present everything you need to try to bring it back on Reshade.

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

  • Ioxa
More
9 years 3 months ago #10 by Ioxa Replied by Ioxa on topic The Gaussian effect
I think I got it. I ended up not using the BrightPassFilter, it just didn't look right, and for the PassThrough return I did this,
return tex2D(origframeSampler, IN.UVCoord) + tex2D(frameSampler, IN.UVCoord);
that finally got color right.

Thanks for all your help crosire! No way I would have got this working without it!

Where can I upload this so other people can try it if they want?
The following user(s) said Thank You: Wicked Sick

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

  • crosire
More
9 years 3 months ago #11 by crosire Replied by crosire on topic The Gaussian effect

Ioxa wrote: Where can I upload this so other people can try it if they want?

There's a shader presentation section here made for that purpose =)

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.