Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimum changes to glsl-sandbox to get WebGL 2.0 working #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Spaxe
Copy link

@Spaxe Spaxe commented Apr 12, 2017

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.

@TheLucifurry
Copy link

That PR is still opened)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants