- Home /
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.
Answer by Glurth · May 19, 2016 at 01:29 AM
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 (http://docs.unity3d.com/ScriptReference/GL.html). 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. (http://docs.unity3d.com/462/Documentation/Manual/SL-BuiltinValues.html)
Your answer
Follow this Question
Related Questions
Unlit Transparent With Color Support 1 Answer
create a texture with shader code? ( without using a texture ) 1 Answer
How to add Emission to my custom shader? 2 Answers
The Best Way To Make Stylised Grass in Unity? 0 Answers
How to get the value of a pixel of a noise node if it's greater than some threshold? 0 Answers