static const char *g_shader_geom_worm = ""
#if defined(USE_LD)
"worm.geom.glsl"
#else
"layout(lines_adjacency)in;"
"layout(triangle_strip,max_vertices=102)out;"
"in g"
"{"
"vec3 i;"
"vec3 a;"
"vec3 r;"
"vec3 c;"
"vec4 e;"
"float v;"
"float o;"
"mat4 t;"
"}"
"e[4];"
"out g"
"{"
"vec2 e;"
"vec4 c;"
"float t;"
"flat int o;"
"}"
"c;"
"vec3 a(vec3 v,vec3 c,vec3 o,vec3 i,float e)"
"{"
"vec3 t=mix(c,o,e);"
"return mix(mix(mix(v,c,e),t,e),mix(t,mix(o,i,e),e),e);"
"}"
"void main()"
"{"
"vec3 o=e[1].c,v=e[2].c,i=normalize(v-e[0].c)*length(v-o)+o,r=normalize(o-e[3].c)*length(o-v)+v;"
"for(float t=0;"
"t<=1;"
"t+=.02)"
"{"
"vec3 l=a(o,i,r,v,t),n=normalize(cross(normalize(a(o,i,r,v,t+.01)-a(o,i,r,v,t-.01)),normalize(e[1].r-l)))*e[1].e.r;"
"c.t=mix(e[1].v,e[2].v,t);"
"c.o=2;"
"c.e=vec2(-1,t+e[0].o);"
"gl_Position=e[1].t*vec4(l-n,1);"
"EmitVertex();"
"c.e=vec2(1,t+e[0].o);"
"gl_Position=e[1].t*vec4(l+n,1);"
"EmitVertex();"
"}"
"}"
#endif
"";
