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

Implement missing WebGL functionality #38

Open
vorg opened this issue Apr 16, 2015 · 12 comments
Open

Implement missing WebGL functionality #38

vorg opened this issue Apr 16, 2015 · 12 comments

Comments

@vorg
Copy link
Contributor

vorg commented Apr 16, 2015

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

@deanm
Copy link
Owner

deanm commented Apr 18, 2015

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...

@deanm
Copy link
Owner

deanm commented Apr 18, 2015

commit a0b7ef1
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.

@vorg
Copy link
Contributor Author

vorg commented Apr 20, 2015

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)

@deanm
Copy link
Owner

deanm commented Apr 21, 2015

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.

@vorg
Copy link
Contributor Author

vorg commented Apr 21, 2015

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
#38 (comment).

Marcin Ignac
http://marcinignac.com
@MarcinIgnac

@deanm
Copy link
Owner

deanm commented Apr 21, 2015

commit 8bde40a
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.

@deanm
Copy link
Owner

deanm commented Apr 21, 2015

commit 26482e6
Author: Dean McNamee [email protected]
Date: Tue Apr 21 13:14:34 2015 +0200

Add OES_standard_derivatives extension.

commit d27362d
Author: Dean McNamee [email protected]
Date: Tue Apr 21 13:13:49 2015 +0200

Add OES_texture_float to supported extension list.

@deanm
Copy link
Owner

deanm commented Apr 21, 2015

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.

@vorg
Copy link
Contributor Author

vorg commented Jun 12, 2015

Native (WebGL 2.0 way) OES_vertex_array_object works 👍🏻

@deanm
Copy link
Owner

deanm commented Jun 14, 2015

And that's as adventurous as you've gotten?

@vorg
Copy link
Contributor Author

vorg commented Jun 26, 2015

Draw Buffers and gl_FragData works too. Outputting color, normal, light and final result in one draw.

screen shot 2015-06-26 at 21 21 50

@deanm
Copy link
Owner

deanm commented Aug 24, 2015

I've been using transform feedback, seems to work (with caveats as in the commit logs)

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

No branches or pull requests

2 participants