greggman / twgl.js

A Tiny WebGL helper Library
http://twgljs.org
MIT License
2.61k stars 258 forks source link

TypeError: null is not an object (evaluating 'gl[defaultShaderType[ii]]') #193

Closed hyvyys closed 2 years ago

hyvyys commented 2 years ago

Hi,

I'm getting the following error in Safari 14.1.2 on macOS Big Sur:

TypeError: null is not an object (evaluating 'gl[defaultShaderType[ii]]')

Replication on Codepen: https://codepen.io/hyvyys/pen/mdpbwGX

hyvyys commented 2 years ago

Safari 14 does not support WebGL by default.

greggman commented 2 years ago

Safari has supported WebGL since around 2011. But Safari only started supporting WebGL2 last September 2021 in version 15

hyvyys commented 2 years ago

Oh, right. Should've googled "caniuse WebGL 1"!

I guess the refactor of this sample to use WebGL 1 would be too daunting for me right now, I literally only forked that codepen to link it here for posteriority.

greggman commented 2 years ago

https://codepen.io/greggman/pen/ExoYBOP