Announcement

Collapse
No announcement yet.

How to blur the texture?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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:
    Code:
    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:
    Code:
    CurColor += Texture2DSample(Tex,TexSampler,NewUV);

    #2
    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.
    -TorQueMoD
    www.torquemod.com

    Comment


      #3
      Originally posted by TorQueMoD View Post
      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.

      Click image for larger version

Name:	sca3YyciSP4.jpg
Views:	50
Size:	158.1 KB
ID:	1506526

      Comment

      Working...
      X