Welcome, Guest.
Username: Password: Remember me

TOPIC: The Gaussian effect

The Gaussian effect 1 year 11 months ago #1

  • Wicked Sick
  • Wicked Sick's Avatar
  • Offline
  • Die young or suffer (Forgive my poor English)
  • Posts: 360
  • Thank you received: 105
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."
Finding relief somewhere between a tree's branch and its shade.
The administrator has disabled public write access.

The Gaussian effect 1 year 11 months ago #2

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
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...
The administrator has disabled public write access.

The Gaussian effect 1 year 11 months ago #3

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2458
  • Thank you received: 1394
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.
Cheers, crosire =)
Last Edit: 1 year 11 months ago by crosire.
The administrator has disabled public write access.
The following user(s) said Thank You: Ioxa

The Gaussian effect 1 year 11 months ago #4

  • Wicked Sick
  • Wicked Sick's Avatar
  • Offline
  • Die young or suffer (Forgive my poor English)
  • Posts: 360
  • Thank you received: 105
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?
Finding relief somewhere between a tree's branch and its shade.
Last Edit: 1 year 11 months ago by Wicked Sick.
The administrator has disabled public write access.

The Gaussian effect 1 year 11 months ago #5

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
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.
The administrator has disabled public write access.

The Gaussian effect 1 year 11 months ago #6

Boulotaur had a lot of stuff for Gaussian shader in the dll itself, which is unfortunate for us...
Your inability to make it work doesn't make it broken
The administrator has disabled public write access.

The Gaussian effect 1 year 11 months ago #7

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
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?
The administrator has disabled public write access.

The Gaussian effect 1 year 11 months ago #8

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2458
  • Thank you received: 1394
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.
Cheers, crosire =)
Last Edit: 1 year 11 months ago by crosire.
The administrator has disabled public write access.
The following user(s) said Thank You: Ioxa

The Gaussian effect 1 year 11 months ago #9

  • kurtferro
  • kurtferro's Avatar
  • Offline
  • Posts: 24
  • Thank you received: 1
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.
The administrator has disabled public write access.

The Gaussian effect 1 year 11 months ago #10

  • Ioxa
  • Ioxa's Avatar
  • Offline
  • Posts: 267
  • Thank you received: 245
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 administrator has disabled public write access.
The following user(s) said Thank You: Wicked Sick

The Gaussian effect 1 year 11 months ago #11

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2458
  • Thank you received: 1394
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 =)
Cheers, crosire =)
The administrator has disabled public write access.