Addressing texture

Hi,
Trying to do some picture distortion…somehow it works but i want to keep the transformation inside the texture and not repeating the texture like right now…

The problem is how to translate this:
//distortion *= deltaUV (have a look inside the PS where it’s explained)…

I tried different things like:
float dx = 1/TextureWidth;
float dy = 1/TextureHeight;
distortion *=float2(dx,dy)

but everything was wrong…don’t know how to do it…

TX in advance!

distort.zip (56.6 kB)

the sampler in the shader has some options, how to sample the texture if the coordinates exceed the 0-1 range:

{CODE(ln=>1)}sampler Samp = sampler_state //sampler for doing the texture-lookup
{
Texture = (Tex); //apply a texture to the sampler
MipFilter = LINEAR; //sampler states
MinFilter = LINEAR;
MagFilter = LINEAR;
addressU = clamp;
addressV = clamp;
};^

wrap, border and mirror are also possible options.

I know, i know, i’ve tried it too but i don’t get the expected result…

some graphic cards don’t like some of the wrapping modes with some texturetypes, like videotexture, gditexture and dx9texture. some one work with nonpow2-textures or non-square textures…

try the same with a filetexture to see if that could be in issue. also open a renderer (tty). maybe you get some errormessages…

Along the same kind of lines is it possible to have a pinout with the Texture wrapping methods on? so users can select the modes?

Thanks in advance