Is WebGL 2 supported yet?
See original GitHub issueI’m using the latest version of PIXI, and want to upgrade an existing frag shader to use WebGL 2. I cannot find any documentation for doing this with PIXI 6, and the issues I found were closed by the bot without a conclusion.
I tried this frag shader (using the default vert shader):
#version 300 es
in vec2 vTextureCoord;
uniform sampler2D uSampler;
out vec4 color;
void main(void) {
color = texture(uSampler, vTextureCoord);
}
This is the (primary) error:
ERROR: 0:3: 'version' : #version directive must occur before anything else, except for comments and white space
Can I use a WebGL 2 frag shader in a PIXI 6 filter?
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
WebGL 2.0 | Can I use... Support tables for HTML5, CSS3, etc
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >Your browser supports WebGL2
Your browser supports WebGL2. You should see a spinning cube. If you do not, please visit the support site for your browser.
Read more >Browser Compatibility Testing of WebGL 2.0 - LambdaTest
BROWSER SUPPORT FOR WebGL 2.0 · Google Chrome · Mozilla Firefox · Internet Explorer · Safari · Microsoft Edge · Opera.
Read more >How to use WebGL2
As of September 2021, WebGL2 is available in the latest versions of Chrome, Edge, Firefox, Safari and Opera. Note that in Safari WebGL2...
Read more >WebGL 2.0 is Now Supported in All Major Browsers - 80 Level
The Khronos Group announced that WebGL 2.0, which renders interactive 2D and 3D graphics without using plug-ins, is now supported in all ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@frankandrobot You pass
undefined
, which defaults to the standard version 100 vertex shader regardless of whetherPREFER_ENV
isWEBGL2
:new Filter(undefined, frag, ...
. You need to pass the version 300 vertex shader posted above. Both the vertex and the fragment shader must be the same version.The renderer can be set to pick WebGL 2 if available with
PIXI.settings.PREFER_ENV = PIXI.ENV.WEBGL2
I don’t do filter stuff myself, so couldn’t tell you if Pixi will have any issues with the shaders.