glsl-sandbox
glsl-sandbox copied to clipboard
Minimum changes to glsl-sandbox to get WebGL 2.0 working
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.
That PR is still opened)