patriciogonzalezvivo / glslCanvas

Simple tool to load GLSL shaders on HTML Canvas using WebGL
http://patriciogonzalezvivo.github.io/glslCanvas/
MIT License
1.95k stars 180 forks source link

WebGL 2.0 #27

Open alijaya opened 6 years ago

alijaya commented 6 years ago

Is there any possibility to use WebGL 2.0?

patriciogonzalezvivo commented 6 years ago

Hi. Yes. It will take time and work.

In case some one want's to take this one, by default should run WebGL 1.0 to keep legacy compatibility to the BookOfShader and glslViewer.

We can implement it using flags when is add as a HTML component. Ex:

<canvas class="glslCanvas" data-fragment-url="shader.frag" width="500" height="500" data-webg="2"></canvas>

and when is use as a JS class, something like:

'var sandbox = new GlslCanvas(canvas, { webgl_version : 2 });'

alijaya commented 6 years ago

I'm not really sure whether webgl 2 is backward-compatible with webgl 1. If it's yes, I think we can make it as the default if the browser supports the webgl 2, and will go webgl 1 if the browser doesn't support.

patriciogonzalezvivo commented 6 years ago

I believe they are different versions of GLSL. WebGL 1.0 use the same of OpenGL ES 2.0 and WebGL 2.0 of OpenGL ES 3.0

Sent from my iPhone

On Apr 26, 2018, at 5:36 PM, Ali Jaya Meilio notifications@github.com wrote:

I'm not really sure whether webgl 2 is backward-compatible with webgl 1. If it's yes, I think we can make it as the default if the browser supports the webgl 2, and will go webgl 1 if the browser doesn't support.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

yohan-pg commented 5 years ago

I'm very interested in this feature. Any chance of merging this PR soon? I'd be glad to help if I can.

marcosrocha85 commented 4 years ago

Still not supporting WebGL 2.0 I needed to use mat4x2 and cannot because glslCanvas still on WebGL 1.0 =(

Larphoid commented 3 years ago

For anyone interested in this, take a look at issue #71 that I posted.