SpiralBlur Texture wraps over texture border

Hi there!

I am trying to make a simple “grow” function that uses a 0,1 mask and grows the 1 texture. I try doing it with a blur and want to clamp the resulting texture to 0,1 so the blurred area becomes 1 too.

I use the “SpiralBlur Texture” node for it. Unfortunately as you can see below, the Blur results in a blurred part on the other side of the texture (right side). This is kinda game breaking though. What can be done to fix that?

338329-preview.png

Thanks and cheers

Got it!

I’ll share my solution here!

As the SpiralBlur is only a material function, it can be double clicked and opened in editor. ‘Browse’ to see it in the explorer, duplicate it to a personal folder and rename it to _custom something…

Then in the Custom HLSL node, cover the line that adds the blur to the color in an if like so:

if(NewUV.x >= 0 && NewUV.x <= 1 && NewUV.y >= 0 && NewUV.y <= 1)
{
	CurColor += Texture2DSample(Tex,TexSampler,NewUV)*distpow;
}	

That way, the functionality stays the same except that it doesn’t add colors sampled from wrapped UVs (<0 | >1), effectively clamping the UVs and avoiding bleeding at the texture borders.

338694-preview2.png

2 Likes