hi,guys. i'm currently using an opensource polyline library ,call "vaser", to draw some smooth mesh line.
unfortunately, it doesn't support texture, just vertex color, so i have to find a way to embed texture into to satisfy my needs but i don't wanna take much time and effort to read the source. i have done some try, including gl_object_linear implementation in glsl, it' didn't work as i expect because there 's lot of planes exist.
here is my code:
texture's wrap is repeat along distance.
varying vec2 localpos;
uniform float width;
vec4 u = vec4(1.0,0.0,0.0,0.0);
vec4 v = vec4(0.0,1.0,0.0,0.0);
float _u = dot(vec4(localpos.xy,0.0,0.0),u) / width ;
float _v = dot(vec4(localpos.xy,0.0,0.0),v) / width;
gl_FragColor = texture2D(CC_Texture0, vec2(_u,_v));
acutally i need _v always be 1.0 at bottom, be 0.0 at top, but i can't get it through, hope your guys help me.
sorry for my bad english :).