In order to implement lines with custom widths in 3D space.
To calculate the direction of the vertex offset, you need to know the two adjacent points. At the same time, in order to keep the width from changing with the viewing angle, you need to update the direction of the offset in real time, so I think it is necessary to calculate the offset direction in the shader. This It is also necessary to pass adjacent points to the shader.
I've also tried storing vertex data to vertex colors, but I get values between 0 and 1 in the shader. Thank you for your answer, I will try other data slots or other methods. Maybe this method is really stupid.