Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use WEBGL_provoking_vertex and flat shading for attributes #248

Open
tuner opened this issue Mar 14, 2024 · 0 comments
Open

Use WEBGL_provoking_vertex and flat shading for attributes #248

tuner opened this issue Mar 14, 2024 · 0 comments
Labels
core Related to the Core package good first issue Good for newcomers performance WebGL Somehow related to WebGL or GPU

Comments

@tuner
Copy link
Member

tuner commented Mar 14, 2024

Flat shading, which prevents unnecessary linear interpolation, is a performance disaster on Arm macs (see #119). However, there's a new extension that might solve the problem and allow for using flat shading: WEBGL_provoking_vertex

For instance, "point" mark's fragment shader has the following varyings, which are linearly interpolated between the vertices, even though they are same for all the vertices:

in float vRadius;
in float vRadiusWithPadding;
in lowp vec4 vFillColor;
in lowp vec4 vStrokeColor;
in lowp float vShape;
in lowp float vHalfStrokeWidth;
in mat2 vRotationMatrix;

Using flat shading would likely improve the performance a bit. Also, boolean and integer varyings can only be used with flat shading.

@tuner tuner added good first issue Good for newcomers core Related to the Core package performance WebGL Somehow related to WebGL or GPU labels Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the Core package good first issue Good for newcomers performance WebGL Somehow related to WebGL or GPU
Projects
None yet
Development

No branches or pull requests

1 participant