Help on How To Create a Distorted Waving/Oscillating Texture in a Material [Solved!]

I need help creating a waving texture in a martial. I want it to animate like in older snes/Genesis games when objects where underwater (or in hot areas) for a 2D Project i’m working on. It would probably need to use World Position Offset in order to not mess up the papersprites sprite image (it doesn’t repeat like a normal texture) but if i could figure out how to distort the texture I should be able to figure out how to apply it to the World Position Offset.

I used a shader code from shadertoy Shader - Shadertoy BETA and I almost got it to work but since i don’t know what FracColor is and the fact that you can’t store variables that you can set inside materials I can’t get it to work right :frowning:

I have included a picture of the effect I was wanting (top left box to top right box) along with one showing how close i am to getting it.

I’ve been trying to figure this out for months but have had no luck, if there’s some one out there that can help me this that would be great!

Hm, my solution is probably very simple but it does come really close to what you want to achieve and can give you some ideas. I used a wavy texture (check screenshot) that is blurred and tileable to manipulate the uv space of a checkerbox texture. So if you make the wave texture to be big enough you will get the wavy motion on the texture (in your case, the normal map).

Thanks for offering help NasteX, but I finally got the shadertoy shader to work. Turns out I missed one line of code!

Ok well I went to try the shader one more time from scratch and I got it to work! If anyone else out there is looking for how to do this well here you go, credit to JasonD from ShaderToy for doing the math
Note: you will have to use small values or it will get to distorted and look bad and you will probably have to scale the distortion to fit your mesh size


I am happy that you found solution! Thank you for sharing! :slight_smile:

I was just banging my head against the wall trying to make an effect like this. Thanks so much for sharing your solution!