Trying to understand sine waves and time for materials

Hi guys,

I’m kind of stuck here with a material I am creating and would appreciate some help.
In this material I have a texture (drops), which I want panning from top to bottom, while at the same time moving left/right back and forth slightly. To achieve the latter, I’m using a sine node, which I plug into the panner node.

However, as time progresses, the left/right movement gets stronger and stronger, and I simply don’t understand why this is happening. It’s the first time I’m using the sine node, so I guess I don’t quite understand how it works after all.

Here is a screenshot of my node graph, with descriptions of what each section is supposed to do:

With an extremely simplified version of this graph, the exact same thing happens:
OSjnZ5f

What am I doing wrong here?

1 Like

Like with a lot of code, it could be wise to delete each small bit, one at a time, and make sure you know what each node is doing. I’ve never worked with the ScreenAlignedUVs node or the Panner node very much so I can’t say how they work, but deleting (or just disconnecting) nodes one at a time and making sure they’re doing what you want them to is probably the way to go until somebody who knows something about this responds with a valid solution.

Just

image

will move the drops downward ( Y ).

You want to distort the UVs in X, possibly using a sine.

This is the first step, the problem is it distorts X evenly

rain1

So an approach where you change the amount of distortion based on how far down Y you are, but I think that still won’t cut it.

I had a look at a good raindrop shader I’ve got, it uses another texture to do the X warp ( and it’s a whole thing… ).

This aleady does the X warp better than a sine, I think

rain2

Better again

rain3

I’d get a zebra texture and you’re done :smiley:

The one I’m using here is from

https://www.unrealengine.com/marketplace/en-US/product/luos-s-noise-texture-pack

Very good pack, always using it.

Probably some similar textures on google…

1 Like

Ah yes. I put the nodes for the X warp behind the panner node, as you did, and it works like a charm. Using a texture instead of a sine node is also a great idea, I think I’m gonna do that.

Thanks for the advice!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.