Applying blur to texture

First thing to know, I barely don’t understand anything about shaders. I’m learning slowly how this works but I’m in lack of so many notions. I know it’s not the best way to introduce a question but it is, I think, necessary for the potential answer.

So, I’ve been trying to tweak every blur shader I could find on the interwebs for weeks that could be added to the default UI Sprite shader.

I’ve found something ( https://www.shadertoy.com/view/Mtl3Rj ) that I’ve been able to “translate?”, but I have an issue that I can’t manage to resolve ( Last thing to know, for now, I’ve been able to only perform a single pass blur ), anyway:

The texture gets quite blurry, so it’s a small win, but I would like to expand the blur over the “end” of the texture, where the aliasing appears.

2419066--165463--testShader.png

Here is the fragment part modified from the original (Default Sprite UI ) one:

fixed4 frag(v2f IN) : SV_Target
 {
return BlurV(_MainTex, fixed2(128,128), IN.texcoord, 5);
}

Hope someone could give a hint to make it works.

PS: I can show the BlurV implementation if it’s relevant

Thanks in advance

Please show it! :stuck_out_tongue:

And just for understanding: are you trying to achive anti-aliasing or do you want to blur the whole texture?

Haha yeah, it seems pretty damn integral to solving your issue, most of us know what a function call in a fragment shader looks like :wink:

Seriously tho, per shader pixel blue is expensive. If you have too, try looking up seperable blurs.

Essentially you want to have multiple texture samples around a pixel and use the offset of that sample to control the amount of each blur, this can then be weighted to give a falloff.