Looking for a solution to animate a line along its direction

Hello!

I am currently working on a project where i have to show different data flows using the line-renderer. I am searching for a performant way to visualize the direction the flow is flowing :slight_smile:

The most basic way, modifying the offset of a texture leaves a lot to be desired. It does not look good if the flow line drastically changes directions and it only moves in the same direction everywhere on the line.

What i would love to see is either a texture moved along the line, so it changes the direction as the line changes direction or some sort of vertex animation in the direction the line goes…

I tried a few things with a surface shader but it seems like i can not easily get the directio of the line.

Do you guys have any ideas what i could try?

Thanks!

Vectrosity on the asset store is really good and would probably do the kind of thing you’re looking for - it’s not free though.

Demo 6 has some lines being drawn gradually: starscenesoftware.com - starscenesoftware Resources and Information.

Thanks for the hint but it does not look like it can do what i want. I do not want to animate the creation of the line. I want to visualize the flow in the direction of the line. So the line is already there and i want some kind of effect so the viewer can see from where to where the flow is going. Like a top down view of a river…

You could draw your lines manually using GL.Lines (Unity - Scripting API: GL.LINES) - for each line you could split it into 3 parts which would let you have the middle part highlighted as it moved along the length of the line.

shaders,

linerenderer with scrolling UV shader
3242841--249353--scrolling-uv-shader.gif

source

6 Likes

@mgear you my friend deserve a medal. That is exactly what i was looking for and to be honest, i learned how to do that in university a few years back but my brain just did not come up with that solution… :slight_smile:

1 Like