How can I distort a texture using the Sine node?

I want an effect like is on the white foam textures in this gif, I’ve read online that it’s achieved using sine waves to distort the UV coordinates. That makes sense, but I can’t figure out the implementation of it at all. Can someone just rundown quickly how you would do this?

Here’s my best attempt

The texture I’m manipulating is this

follow this: [UE4] UV distortion/Lightning tutorial - YouTube
that will teach you what to do :slight_smile:

This didn’t answer my question, I appreciate it as an alternative but I specifically want to know how to use sine functions. This tutorial uses panner nodes. I tried to maybe apply this sort of thing to sine waves but I still can’t figure it out, I must be missing something.

Thank you, this is what I needed to know. I had figured out most of what you said just not the exact implementation. I don’t know if you looked at my attempt, but I was trying to use the Texture coordinates as input for the sine, I just don’t understand the math well enough to know what I’m doing. Thanks!

A sine wave will only output a scalar value. You would have to use it in conjunction with other nodes to create a pattern that could be used to distort UV coordinates. If you use it by itself, it would shift the entire image and not look terribly interesting.

You could, for example, take a texture coordinate node and a Vector2 node set to (0.5,0.5) and feed that into a distance node, then feed that into a sine node to get a circular wave pattern which you could add to another texture coordinate which could feed into a texture’s UV coordinates. That would be one way.

Another could be to multiply the U channel of a texture coordinate by a scalar parameter (say 3), then feed that into the sine node and add the result to another texture coordinate and feed that into a texture’s UVs. Changing the scalar value will then get you a repeating sine pattern across the U axis of the texture. You can modulate (multiply by a scalar) the pattern before you add it to the texture coordinates to vary the amount of distortion you get.

Could you possibly help me one more time? I was able to implement your solution, but I ran into a problem. I want the sine distorted texture to tile by world coordinates, and it works along the Y axis, but not the X. I don’t know how to fix this or what I’m doing wrong, I’d appreciate the help.