consider glPolygonMode
Closed this issue · 5 comments
kipodon commented
consider glPolygonMode
kipodon commented
at least with GL_LINE
greggman commented
glPolygonMode does not exist in OpenGL ES
lexaknyazev commented
Although it does not exist in OpenGL ES core specs, there is a GL_NV_polygon_mode
extension. It's not fully portable, though:
- Implementing
GL_POINT
polygon mode on top of Direct 3D or Metal would be very difficult. - Among native OpenGL ES drivers, only NVIDIA supports this feature.
- Among Vulkan mobile drivers, only NVIDIA and Adreno support this feature.
That said, a subset of this extension with only GL_LINE
and GL_FILL
(default) modes seems implementable.
kenrussell commented
At some point we have to stop adding features to WebGL, and given that both points and lines are already problematic in WebGL implementations (uninitialized gl_PointSize
has undefined behavior, and many implementations don't support line width greater than 1), I don't think this feature makes the cut.
lexaknyazev commented
- This feature (aka
FillMode
) allows triangle primitives to be rendered as edges; it's not related to point and line primitive types and their limitations. - Engines usually build an extra index buffer in JS and use line primitives to render a wireframe of a model made of triangles. Having this toggle would allow reusing the original VAO state thus reducing CPU work and data uploads for such cases.
- Although mobile support is very limited, desktop support is nearly universal (assuming that
GL_POINT
is removed).