Gaussian Blur Glow Effect Help

I don’t really know what to call this but in reshade, there is a shader for the 1.1 version called gaussian blur / bloom / unsharp mask by Ioxa. With this shader I can get a gaussian glow effect that I love. The problem is, he couldnt update it to the latest version and have it look the same. And since reshade isn’t going to be for vulkan anytime soon, Im stuck on opengl for retroarch because I can’t find any version of that shader that has this effect that I like. If this shader can be made for vulkan, I’ll have no future need of reshade for retroarch for this is the only thing I use reshade for on the retroarch front. This is what the effect looks like:

@HunterK, can you help me out as to what this effect can be dubbed (just in case it has another name and is already made somewhere in retroarch shader library). And if it isn’t, can you make a slang shader of this effect? Thanks in advance.

Try this one:

Thanks! I use scanlines in overlay form already so that’s taken care of. As far as the xbrz goes, I was waiting on sp00kyfox to finish his scalenx port. So is there any way you can get that gaussian haze to a shader by itself with intensity options in the menu?

no, it’s a multipass effect (blur horizontal, blur vertical, combine the blurred passes with a previous unblurred pass), so it can’t be made into a single shader. However, you can just take the scanline pass off the end and then change the combine pass to use mix(blurred, unblurred, parameter) to get a variable effect, and you can add those 3 passes onto the end of whatever Sp00kyFox comes up with.

I wrote a simple bloom shader (misc folder) which is fully customizable, very fast and it should be easy to port to slang also. I guess it looks nice enough to give it a try. Following @McSwingles’s idea i also created a preset (could be put into xsal, since it’s “from all winds” :slight_smile: ) and it looks quite nice to me.

EDIT: Major improvement to bloom shader. Now it can bloom more smart. The preset also got optimized, silly me, now i get how the excellent blurs work. :slight_smile:

I’m already finished with the translation to slang. I just wanted to work on the algorithm itself before releasing it officially but whatever. here you go: https://mega.nz/#!3AwhiYxB!kQlVFgEL3gpjbWXvXGgdMbFFkcICAYQbtZuE0_kKC8E

@hunterk & co please wait for an official release by me before uploading it to the shader repository.

Thx everybody, I will give all of these a try.

Edit: @HunterK: when I change the .slangp file to:

shaders = 3

shader0 = shaders/blur11resize-horizontal.slang filter_linear0 = true

shader1 = shaders/blur11resize-vertical.slang filter_linear1 = true

shader2 = shaders/combine.slang

I dont see the haze effect. What did I do wrong? Even if I just take scanlines off, seems that the entire effect gets broken.

Edit2: when i try to try out the scalefx and load its preset, nothing happens in menu or in game. Shader passes stay at 0. But I can wait until it is released identically as it was for the other backends.

check out the commandline window to see what’s going on. seems like the preset either can’t find the shader files or vulcan is not activated. the version I posted is already identical to the cg version algorithm- and output-wise.

sp00kyfox

hunterk:

vec4 blurred = pow(texture(Source, vTexCoord), vec4(2.2)); vec4 unblurred = pow(texture(PASS1, vTexCoord), vec4(2.2)); vec4 dark = vec4(pow((unblurred + blurred) / 2.0, vec4(1.0 / 2.2))); vec4 bright = vec4(pow(vec4(1.0) - (vec4(1.0) - unblurred) * (vec4(1.0) - blurred), vec4(1.0 / 2.2))); FragColor = (params.bright < 0.5) ? dark : bright;

Which should I change? When I have rez at 720p, I can see the haze. At 1080p I can’t.

@McSwingles what brand GPU do you have? I’m assuming non-Nvidia and Sp00ky Fox has Nvidia?

@Sp00ky Fox If my suspicion is correct, Nvidia is more permissive than AMD/Intel about implicit casting in functions like min/max/pow. For example, pow(image.rgb, 2.2) works with Nvidia but fails with the other vendors with an ‘ambiguous function signature match.’ Instead, you have to do pow(image.rgb, vec3(2.2)).

My bad, after these settings hunterk, I can see the haze but it is super blurry without the 4xbrz. So does the haze alone HAVE to be with another shader to look correct?:

shaders = 3

shader0 = shaders/blur11resize-horizontal.slang filter_linear0 = true scale_type0 = source alias0 = PASS1 filter_linear0 = false

shader1 = shaders/blur11resize-vertical.slang filter_linear1 = true

shader2 = shaders/combine.slang

I have an nvidia gtx 980M graphics card.

please replace the pass1 file with this version here and let me know if it goes through. I haven’t touched the other files yet: https://mega.nz/#!qZJ0jagS!TI-ibt3lXCd4WIb8DZTYGue530KETxUacw4Iq9mkDz8

ps: post another error log if it isn’t working again.

@hunterk got a GTX 760 here. maybe it’s an issue with the mobile GPUs.

could you check if this also happens with a recent nightly build? if I can I wanna avoid changing the code further.

http://buildbot.libretro.com/nightly/windows/

@McSwingles I tailored it to expect a first pass at >=2x scale (greater scales make it less blurry), and the PASS1 part is supposed to point to a non-blurry image. Instead of getting rid of the first xbrz pass entirely, just change it to ‘stock’ (it also works well with guest’s new 2xsai-lvl2 shaders) and keep the alias and scale factor intact.

@Sp00ky Fox Another thing that seems to be tripping it up is 0 vs 0.0, 2 vs 2.0, etc. in a few of the functions. I cleaned those up and got it to work on my Shield ATV. Here are my changes:

I took a look at the haze-blur shader (Reshade) and saw, that it offers sharpening also (which is commonly done by subtracting a gaussian kernel). So i modified one of the blurs file to do the same and result is hazy blur, but it’s a conceptual start, not optimized yet. The blur file goes into blurs folder, the preset can be put in xsal. I’m curious if this is the step in the right direction…

Edit: this stuff is derelict, i’m porting OP’s original code

@HunterK&Spookyfox - works with newer version of retroarch. Scalefxx9 options are missing in the menu shader parameters though. @guestr - the new version of that reshade shader is not so good. Here is the older version which is excellent: https://mega.nz/#!W10FQa5D!zLz4__9PUXhHhqGODdG5D12ycDJbdhPdUQPy8fqYiAU Works under the 1.1 version only. The only reason I refuse to upgrade xD

Reshade.fx =

  • =============================================================================
  •                                Effects
    
  • ============================================================================= */

#include “ReShade\Pipeline.cfg” #include “ReShade\GAUSS4Sh1nRa358newFW.fx”

Only change these in the fx file: //GaussStrength //[0.00 to 1.00] Amount of effect blended into the final image. #define GaussStrength 0.45

//addBloom //Set to 1 to add bloom to Blur or Unsharpmask. 0 = off. Set GaussEffect to 0 for bloom only. #define addBloom 1

//Bloom Strength //[0.00 to 1.00] Amount of addBloom added to the final image. #define BloomStrength 0.33

Make addbloom 0 to see the haze by itself. Default value for the haze is 0.30

This is the best i can do for today, it looks rather nice to me. I hope GaussSlantPass isn’t needed because it would take extra work lol.

blur-combine-1.1 goes into the blurs folder, the preset can be put into xsal folder.

@McSwingles if you could test it (you know the righ combo) and say what you think about it that would be nice. I think it could be ported to slang with no problems.

Edit: the “slant” pass is essential for the haze effect. This version isn’t needed i guess.

Oh I havent tested that yet. Don’t worry, I will. Has just been hectic. I have to make a 12 hour drive in a few hours. #exhaust

I added gauss slant pass and it works differently, probably better. :slight_smile: The bloom is OK imo. Here is a comparison how it goes against 3x3 gaussian blur.

Blurs go into blurs folder, preset can go into xsal.

Edit: merged into one pass, parameters added for easier adjustments, small bug in preset fixed.