[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Extensions

On Tue, Mar 27, 2012 at 3:51 AM, Alan DuBoff <aduboff@us.fujitsu.com> wrote:
I was trying to understand how the WebGL extensions work. 
What is not clear to me is if I can add extensions to the Android Browser
myself, and if so, how would I go about that?

OpenGL ES exposes a number of extensions: http://www.khronos.org/registry/gles/
A small subset of those (roughly) is defined for WebGL: http://www.khronos.org/registry/webgl/extensions/

If you want to introduce an extension to a browser you're distributing, you've got to modify that browsers webgl context implementation (gl = canvas.getContext('experimental-webgl')) and provide:
- extension = gl.getExtension(name) -> returns the extension object
- gl.getSupportedExtensions() -> a list of strings of supported extension names
- extension -> an object containing whatever enumerants and symbols required by the extension

In some cases an extension changes the behavior of existing functions, which mostly affects error validation on passed arguments (for instance texImage2D for float textures).

As an example of how an extension was introduced (to Firefox) see this bug thread: https://bugzilla.mozilla.org/show_bug.cgi?id=728354

In case you're planing on adding a new extension of your own, please consult the ML-archives and grep for my email (pyalot@gmail.com) and anisotropic filtering, in short the process is:
- propose an extension as IDL
- post it to the ML
- see if we can reach a consensus over the standardization of it, and it can move to draft
- at that point vendors should be free to implement it