How to blur the texture?

Hello!
I’m trying to blur texture. I finded how to blur Texture Object (Texture2D), but is it possible to blur TextureSample (float3) ?

There code for using with Texture Object:


float3 CurColor;
int i;
Steps = max(Steps, 1);
float StepSize = Distance / (int) Steps;
float2 NewUV = UV - Vector*0.5*Distance;

while ( i < (int) Steps)
{

CurColor += Texture2DSample(Tex,TexSampler,NewUV);
NewUV.x += (StepSize * Vector.x);
NewUV.y += (StepSize * Vector.y);
i++;
}
CurColor = CurColor / i;
return CurColor;

I think that if I find a replacement for this function, everything should work out:


CurColor += Texture2DSample(Tex,TexSampler,NewUV);

I’d post this in the C++ gameplay section of the forums, you’ll likely to get more help there. What exactly are you trying to achieve? You might be able to do it through the material rather than trying to do it with code.

Hi, thx for response!
I try to use curves as in 3D texturing programs. But they are now too sharp. For best effect, I want to try to blur them:
And resulting curvature map has a format - float3.