Electric Wireframe Line Shader

Hi Everyone,

I was wondering how hard something like this would be. Basically you would have a model viewed as a wireframe, and every edge/line is actually moving around like electricity. Would I need to add vertices between edges to allow it to move or is there a way to manipulate an edge by itself? Any sort of links on this would be appreciated. I’ve been playing around with programming shaders and am interested in how something like this would be done.

Thanks.

Sounds like you’re looks for a very general answer, so here goes:

I did something like this myself, here’s how:

I send the lines I want draw to the GPU via the GL drawing functions (Unity - Scripting API: GL). I make sure the vertex I provide for the beginning of the “flow” has a uv x-coord of 0, and the end of the “flow” vertex has a uv x-coord of 1.

A custom shader can then internally read and manipulate the uvs, and colors drawn. These uv’s and colors can be animated with shader time functions. (Unity - Manual: ShaderLab built-in values)