Skip to content

Check for WEBGL_provoking_vertex extension#357

Merged
dmarcos merged 1 commit into
sparkjsdev:mainfrom
mrxz:provoking-vertex
Jun 1, 2026
Merged

Check for WEBGL_provoking_vertex extension#357
dmarcos merged 1 commit into
sparkjsdev:mainfrom
mrxz:provoking-vertex

Conversation

@mrxz
Copy link
Copy Markdown
Collaborator

@mrxz mrxz commented Jun 1, 2026

Depending on the exact system configuration, the preferred provoking vertex convention might differ from the WebGL/OpenGL default. This can be communicated by the browser by exposing the WEBGL_provoking_vertex extension. In other words, the presence of this extension itself indicates it's worth changing the provoking vertex. This PR checks for the extension and sets FIRST_VERTEX_CONVENTION_WEBGL if present.

Going by the Web3D survey data (https://web3dsurvey.com/webgl2/extensions/WEBGL_provoking_vertex) this is relevant for the vast majority of Windows and Mac and iOS devices. Testing on a Windows laptop did show a really nice jump in performance.

This only applies when using flat interpolation in shaders, which Spark does. Since these values should be the same for each vertex, changing the provoking vertex makes no semantic difference. That said, it is a global configuration, meaning other uses might be impacted if they rely on flat interpolation picking the last vertex.

@dmarcos dmarcos merged commit 4df4a08 into sparkjsdev:main Jun 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants