How to warp an image based on another one?

Hi everyone,
I’m struggling with it for a while… But I can’t figure how to warp an image using another one as a displacement map.
I’d like to do it with nodes (or maybe OSL or python ?)
The idea is to have an entry image (or texture) and a displacement texture, let’s say a grayscale noise texture. Each pixel at (x,y) of the output would be the pixel value of the input image (r,g,b) at coordinates (x+warp ,y+warp) where warp is the pixel value of the displacement texture at (x,y), as it is a grayscale texture, warp could be any of r,g,b channels.

I’ve tried to explained it simply, sorry if it is not… But the idea is very common actually.

Thank you for your help !

Hi, you can use the vector math node’s add operation to change any texture’s coordinates

Thank you Hadriscus.
But when I use the vector math node’s add operation it adds the value of the pixels, it does not operate on the texture coordinates.
Have I missed something ?

you should add it to the texture coordinates, the blue socket (vector)

It works ! I forgot to add the Texture Coordinate node to the Vector Math node :grinning:

Here is a simple exemple of a distorded checker texture.

Many thanks !

1 Like