glsl-sandbox icon indicating copy to clipboard operation
glsl-sandbox copied to clipboard

Minimum changes to glsl-sandbox to get WebGL 2.0 working

Open Spaxe opened this issue 7 years ago • 1 comments

Hello,

This is a set of changes to get WebGL 2.0 going in glsl-sandbox. You can see the result here: https://spaxe.github.io/glsl-sandbox/

Caveats:

  • ~Fragment Shader must be written with #version 300 es. This can be detected and change the vertex shader to fit.~ The program now detects WebGL version in browser. Could be smarter about shaders, though.
  • I haven't tested it with the Ruby setup.
  • Haven't looked at core/extensions.

Changes:

  • Backwards-compatible WebGL context detection.
gl  = canvas.getContext( 'webgl2', contextAttributes )
   || canvas.getContext( 'webgl', contextAttributes )
   || canvas.getContext( 'experimental-webgl', contextAttributes );
  • Updated example shaders in static index.html page to GLSL ES 300.
  • No change to server folder.
  • Updated default shader to GLSL ES 300.

Spaxe avatar Apr 12 '17 05:04 Spaxe

That PR is still opened)

TheLucifurry avatar Jun 14 '21 08:06 TheLucifurry