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

Diff between webgl and webgl2 for ALIASED_LINE_WIDTH_RANGE #209

Closed
regseb opened this issue Dec 17, 2022 · 1 comment
Closed

Diff between webgl and webgl2 for ALIASED_LINE_WIDTH_RANGE #209

regseb opened this issue Dec 17, 2022 · 1 comment
Assignees
Labels
unexpected unexpected behavior in browsers

Comments

@regseb
Copy link

regseb commented Dec 17, 2022

CreepJS report this alert on Firefox (not in Chromium):

  • trash (1):
    • webgl/webgl2 mirrored params mismatch: ALIASED_LINE_WIDTH_RANGE,

Looking at the source code, I think CreepJS is comparing the value of ALIASED_LINE_WIDTH_RANGE for "webgl" and "webgl2". Here is a test equivalent:

const canvas = document.createElement("canvas");
const gl = canvas.getContext("webgl");
console.log("webgl:", gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE));

const canvas2 = document.createElement("canvas");
const gl2 = canvas2.getContext("webgl2");
console.log("webgl2:", gl2.getParameter(gl2.ALIASED_LINE_WIDTH_RANGE));
  • GPU:
    • CreepJS: Intel(R) HD Graphics 400
    • lspci: VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)
  • OS : Ubuntu 22.04.1 LTS
  • Browser:
    • Firefox 108.0 (64 bits) / Mozilla Firefox Snap for Ubuntu / canonical-002 - 1.0:

      webgl:  [1, 7.375]
      webgl2: [1, 1]
    • Chromium Version 108.0.5359.124 (Build officiel) snap (64 bits):

      webgl:  [1, 7.375]
      webgl2: [1, 7.375]

WebGLRenderingContext.lineWidth() on MDN:

Warning: The webgl spec, based on the OpenGL ES 2.0/3.0 specs points out that the minimum and maximum width for a line is implementation defined. The maximum minimum width is allowed to be 1.0. The minimum maximum width is also allowed to be 1.0. Because of these implementation defined limits it is not recommended to use line widths other than 1.0 since there is no guarantee any user's browser will display any other width.

As of January 2017 most implementations of WebGL only support a minimum of 1 and a maximum of 1 as the technology they are based on has these same limits.

The only value allowed for the line width is 1 since OpenGL 2. Chromium also accepts only the value 1: Issue 119, but it indicates that the maximum value is 7.375. ¯\_(ツ)_/¯


On other devices:

  • Google Pixel 4a / Android 13:
    • Firefox 108.1.0: webgl: [1, 8] ; webgl2: [1, 8]
    • Chrome 108.0.5359.128: webgl: [1, 8] ; webgl2: [1, 8]
  • NVIDIA GeForce RTX 3060 / Windows 11 Professionnel:
    • Firefox 108.0.1 (64 bits): webgl: [1, 1] ; webgl2: [1, 1]
    • Chrome Version 108.0.5359.125 (Build officiel) (64 bits): webgl: [1, 1] ; webgl2: [1, 1]
@abrahamjuliot abrahamjuliot added the unexpected unexpected behavior in browsers label Dec 19, 2022
@abrahamjuliot abrahamjuliot self-assigned this Dec 19, 2022
@abrahamjuliot
Copy link
Owner

Thank you for bringing this to my attention. This is very informative and well documented. I'm adding ALIASED_LINE_WIDTH_RANGE to allow mismatch. This will prevent this from impacting the score.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unexpected unexpected behavior in browsers
Projects
None yet
Development

No branches or pull requests

2 participants