Closed AslanGM closed 2 years ago
Hi, check what webgl version you are using, as webgl 2.0 can throw such thing (happens for me on chrome) as its not needed there anymore as webgl 2.0 have all standard extensions built in, just need to have es 300 shader
@hansagames hi,
Thanks for your answer!
I checked I have webgl 2.0, and I'm using chrome.
So as I understand, I need to add #version 300 es
in my fragment shader and change the syntax of all variables?
@AslanGoat Yes you need to writte #version 300 es
shader and you dont need to add any extra extensions as it will work out of box, just remeber that shader syntax is a bit different for 300 versus 100.
If you want to support both webgl 1 and 2 then need to write 2 shaders at the moment and then use them based on engine version. I havent found better way at them moment
@hansagames Thanks a lot, mate! You saved me so much time. I made the 300 version, and now everything is working. I'll do two versions as you advised.
Hi there, I've just started to learn WebGL using your library, and I have a question about extensions. I want to use fwidth() in my fragment shader, so I added:
#extension GL_OES_standard_derivatives : enable
But I get the error
Uncaught TypeError: Cannot read properties of undefined (reading 'forEach')
and the warningWARNING: 0:1: 'GL_OES_standard_derivatives' : extension is not supported
.So I need to get this extension from Renderer. I'm doing this:
But I received the same error and the same warning. So I need to make the extension supported, but I can't understand what I'm doing wrong. Can you help me, please?