plask
plask copied to clipboard
Implement missing WebGL functionality
This is more of a todo list for me. Will do pull requests.
gl.getSupportedExtensions() -> [] gl.getExtension(name) -> null gl.drawingBufferWidth -> this.width gl.drawingBufferHeight -> this.height
It looks like my chrome supports:
ANGLE_instanced_arrays EXT_blend_minmax EXT_frag_depth EXT_shader_texture_lod EXT_sRGB EXT_texture_filter_anisotropic WEBKIT_EXT_texture_filter_anisotropic OES_element_index_uint OES_standard_derivatives OES_texture_float OES_texture_float_linear OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_compressed_texture_s3tc WEBKIT_WEBGL_compressed_texture_s3tc WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_depth_texture WEBKIT_WEBGL_depth_texture WEBGL_draw_buffers WEBGL_lose_context WEBKIT_WEBGL_lose_context
A bunch of these should just be supported by the fact that Plask is using desktop OpenGL. Anything specific you want me to look at first?
As a side note, I am still going to look at hooking up the ANGLE shader translator, because with the whole ES2 / ES3 glsl changes, etc, will probably need to have shader rewriting...
commit a0b7ef1c6f44adf61154c20c3a29cf166fd30421 Author: Dean McNamee [email protected] Date: Sat Apr 18 10:36:13 2015 +0200
Add drawingBufferWidth/Height to the OpenGL context.
This is an attribute from the WebGL 1.0 specification.
Anything specific you want me to look at first?
Currently i'm using
WEBGL_depth_texture EXT_shader_texture_lod OES_texture_float (or OES_texture_half_float if not available) OES_texture_float_linear (or OES_texture_half_float_linear if not available)
The annoying thing from my perspective is that getExtension is supposed to return a new object (which I supposed needs the gl context bound) for just the extension methods and constants. This is just a lot of little wrapper objects to create and I find it a bit cumbersome. I will try to just add the extension methods on the main gl object and return that from getExtension. It will work in the sense that the methods and constants you expect to be there will be there, but everything else will be there too, so hopefully that doesn't cause any problems.
Sounds good.
On Tue, Apr 21, 2015 at 9:33 AM, Dean McNamee [email protected] wrote:
The annoying thing from my perspective is that getExtension is supposed to return a new object (which I supposed needs the gl context bound) for just the extension methods and constants. This is just a lot of little wrapper objects to create and I find it a bit cumbersome. I will try to just add the extension methods on the main gl object and return that from getExtension. It will work in the sense that the methods and constants you expect to be there will be there, but everything else will be there too, so hopefully that doesn't cause any problems.
— Reply to this email directly or view it on GitHub https://github.com/deanm/plask/issues/38#issuecomment-94701922.
Marcin Ignac http://marcinignac.com @marcinignac
commit 8bde40aa4342feb67f4713541a185d3ead91f021 Author: Dean McNamee [email protected] Date: Tue Apr 21 13:06:48 2015 +0200
Add WebGL 1.0 getSupportedExtensions and getExtension.
Adds WEBGL_depth_texture as an extension. NOTE: Doesn't return
a proper extension object, but just the main GL object.
commit 26482e65a390dd2e5d6bb0f3a4fc3da90d94ef04 Author: Dean McNamee [email protected] Date: Tue Apr 21 13:14:34 2015 +0200
Add OES_standard_derivatives extension.
commit d27362ddc31cceba3e75e4231138d6c5424d62c2 Author: Dean McNamee [email protected] Date: Tue Apr 21 13:13:49 2015 +0200
Add OES_texture_float to supported extension list.
A lot of these extensions are just adding things that are also added in WebGL 2.0. So I would think the right thing to do is check for the WebGL 2.0 functionality first, and use that instead of the extension. For example ANGLE_instanced_arrays and OES_vertex_array_object.
Native (WebGL 2.0 way) OES_vertex_array_object works 👍🏻
And that's as adventurous as you've gotten?
Draw Buffers and gl_FragData works too. Outputting color, normal, light and final result in one draw.
I've been using transform feedback, seems to work (with caveats as in the commit logs)