Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pixelscommander/isantialiasingsupportedforwebgl
gl.antialias=true does not guarantee it is actually going to be ON because browser accepts antialias attribute just as a hint and decides on itself there. This library checks for actual AA availability.
https://github.com/pixelscommander/isantialiasingsupportedforwebgl
antialiasing detection support webgl
Last synced: 27 days ago
JSON representation
gl.antialias=true does not guarantee it is actually going to be ON because browser accepts antialias attribute just as a hint and decides on itself there. This library checks for actual AA availability.
- Host: GitHub
- URL: https://github.com/pixelscommander/isantialiasingsupportedforwebgl
- Owner: PixelsCommander
- Created: 2018-06-21T09:22:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-21T12:36:39.000Z (over 6 years ago)
- Last Synced: 2024-10-05T12:04:11.350Z (about 1 month ago)
- Topics: antialiasing, detection, support, webgl
- Language: JavaScript
- Homepage: http://pixelscommander.com/polygon/aatest/demo/
- Size: 19.5 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Is Antialiasing Supported? For WebGL ![Image of check sign](./check.jpeg)
You probably heard about WebGL context ```antialias``` property. The interesting fact is that having `true` as a value there does not guarantee antialiasing to be actually enabled. It works just as a hint for browser but there are many reasons it might be disabled and you d like to react on this. For example by enabling shader-based FSAA.
With this library you can actually check if AA works for this machine. Once executed it adds ```window.antialiasingSupported: boolean``` property which is ```true``` if AA is available.
[Demo](http://pixelscommander.com/polygon/aatest/demo/)
## Usage
```npm install isantialiasingsupported```
include into your project and after you may check for
```if (window.antialiasingSupported) ...```
## How this works?
Library creates tiny detached canvas and draws triangle on it with WebGL.
![Image of Yaktocat](./test.png)
If triangle have any pixels except white and black then it is antialiased and ```window.antialiasingSupported``` is set to ```true```.
## License
MIT: http://mit-license.org/
Copyright 2018 Denis Radin aka [PixelsCommander](http://pixelscommander.com)
## Credits
Inspired by my work at [Evolution Gaming](https://www.evolutiongamingcareers.com/search-jobs/?department=Engineering&country=)