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

Consistent antialiasing/multisample default? #525

Open
kpreid opened this issue Jun 29, 2021 · 0 comments
Open

Consistent antialiasing/multisample default? #525

kpreid opened this issue Jun 29, 2021 · 0 comments

Comments

@kpreid
Copy link
Contributor

kpreid commented Jun 29, 2021

(This is a minor issue and should not particularly be prioritized, but I finally realized that it's why I was getting different results and it wasn't obvious to me, so I thought I'd at least write it down.)

  • In luminance-windowing, WindowOpt::num_samples defaults to None.
  • In luminance-web-sys, asking for a context without passing WebGlContextAttributes or using the default values results the WebGL-specified default context attribute antialias: true.

This leads to inconsistent default behavior between the WebGL backend and any that use luminance-windowing. It might be an unpleasant surprise as antialias: true can result in additional artifacts that would only appear on web (depending on what you're doing in your shaders). Additionally, cross-platform apps currently have to use completely different data structures to control this and any future context options.

If there were a luminance-windowing data type holding only context options without window dimensions, then WebSysWebGL2Surface's constructors could accept that data type and convert it to WebGlContextAttributes. Thus, applications could choose to enable or disable antialiasing and any future options (or choose to use luminance-windowing's default) in a cross-platform way.

A simpler alternative — less powerful and potentially more surprising to users familiar with WebGL — would be to change the defaults when the _with_params constructor functions are not used, to have antialias: false.

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

No branches or pull requests

1 participant