Shader and Texture Scrolling depending on Direction

I am trying to scroll a texture using its uv but I don’t get the result I need.

The aim is to have two components, the speed and the direction. I would like to define the direction in normalized values and the speed should influence the velocity of the scrolling according to the direction.

If I change the speed at runtime, I don’t want to have some hiccups but maybe this should not be handled but the GPU.

How can I do that in a better way, maybe using matrix ?

Here is an example but the result is not as good as expected.

uv.xy = uv.xy + frac(_Time.y * float2(_Direction.x, _Direction.y));

I think you have to use your own time value (and get rid of the frac) if you want to change the speed without hiccups.
You can take a look at ‘unity_DeltaTime’ shader variable if you want to do the same on the GPU but you’ll have to figure how to store your time value.

public float speed = 1f;
float myTime = 0f;
Update()
{
    myTime += Time.deltaTime * speed;
    material.SetFloat("_MyTime", myTime);
}