Open norbert-gaulia opened 2 years ago
When drawing lines with simple shader by using join type rect it's rendering with single color:
rect
{ color:['red', 'yellow'], join:'rect', positions: [-0,0,20,10], thickness: 10, dash: [15, 5] }
Adding aColor, bColor to the rect-vert.glsl will produce correct shading
rect-vert.glsl
attribute vec4 aColor, bColor; ... fragColor = (lineStart * aColor + lineEnd * bColor) / 255.;
also changing regl attributes to
aColor: { buffer: regl.prop('colorBuffer'), stride: 4, offset: 0, divisor: 1 }, bColor: { buffer: regl.prop('colorBuffer'), stride: 4, offset: 4, divisor: 1 }
Thank you.
When drawing lines with simple shader by using join type
rect
it's rendering with single color:Adding aColor, bColor to the
rect-vert.glsl
will produce correct shadingalso changing regl attributes to
Thank you.