Glowing line shader

@Luatee ’ OP with that version…’ what does OP mean?!

Don’t forget the glow circle shader! :slight_smile:

@piinthesky Original Post (1st post) and I will post them tonight when I get my iPad back!

@Luatee, this is amazing, may I use it in a game of mine? Also, I was wondering if you think it’s possible to achieve a similar effect for text.

Yes of course @JakAttak it’s here for everyone to use as they like, I was toying with outlining text but I only got a solid black outline, and that’s by making passes of the image in a 1 pixel circle. I’m not sure how I’d do it with glow, I’m going to look in to that a bit more later on.

@piinthesky plug this fragment shader in to the shader lab:

//
// A basic fragment shader
//
uniform lowp vec4 color;
uniform highp float time;
uniform mediump float len;
uniform mediump float width;

//Default precision qualifier
precision highp float;

//The interpolated vertex color for this fragment
varying lowp vec4 vColor;

//The interpolated texture coordinate for this fragment
varying highp vec2 vTexCoord;

void main()
{
    mediump vec2 tn = -1.0+2.0*vTexCoord;
    mediump float dist = sqrt(tn.x*tn.x+tn.y*tn.y);
    if(dist<0.7) discard;
    highp float add = atan(tn.y,tn.x);
    mediump float mp = cos(add*3.0+time*10.0)*(cos(add*3.0)*0.7);
    highp vec4 col = color*len*(-cos(sin(dist*(1.8+mp*0.05))*
    (4.72+width*0.01))*
    (-10.0+width*0.1+(mp)));
    //Set the output color to the texture color
    gl_FragColor = col;
}

It’s not very glow like yet, I have another one rooted around somewhere.

@Luatee - It still needs some perfection, but here’s an early video of what I have: http://youtu.be/z2HRVBabsLo
One thing I plan to do is so not every object is showing a line to every other object.
Thanks!

@Zoyt, video unavailable on mobile…

I like it, it looks a bit messy though when all of them are connected, is there a way you can make a polygon surrounding those bodies and glow that up, that might not be what you’re going for though.

@Luatee - That’s my plan. When I initially made it, it was just a test and I was going to change it later, but I was on a timeframe to release the beta (because I wouldn’t have a computer for a while) and I never got a chance to fix it.
@JakAttak - You might of tried to view it while it was still processing. Try it again.

@Zoyt, either way, I’ve seen it in action.