2
\$\begingroup\$

It says in the OpenGL ES specification that glLineWidth is only required to support values up to 1, but how many OpenGL drivers actually keep this function at the minimum requirement?

\$\endgroup\$
2
\$\begingroup\$

If the WebGL stats are anything to go by it looks like as of recently, 22% of all polled devices from WebGL stats data set only support a line width up to 1. Note that this data is skewed as OpenGL ES as exposed to the browser as WebGL is moderated by the ANGLE layer for Windows platforms for the major browsers which itself doesn't plan on supporting a line width greated than 1. It is also skewed based on the data sources and amount of devices of type that use sites that share data with WebGL Stats (See Contributing Sources)

enter image description here Taken from WebGL Stats -

\$\endgroup\$
2
\$\begingroup\$

Your question as posed is impossible to answer. How many drivers? Any answer will be wrong in a few months time as new devices come out.

Assuming that you're trying to draw thicker lines, you can do it manually by drawing connected quads covering the 2 endpoints of the line segments. You need to decide how you want the connections between segments to look and handle them, but it's not difficult to implement.

What I've done in the past is take the 2 end points and generate vectors perpendicular to the line segment. Extend the endpoints in both directions along the perpendicular by half the thickness of your line. You now have 4 corners for your "thick line segment." If you have another connected segment following the current one, you can calculate the new endpoints for both segments and either extend them so they meet, move the endpoints to the midpoint between them, draw another quad or circle that covers the joint, or any number of other options, depending on the look you want.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.