[Public WebGL] How to check for WebGL support

Tony Parisi [email protected]
Thu May 19 10:40:35 PDT 2011


Hey Vangelis

I like that idea a lot. Keep it simple and clean for the developers, and
efficient. I say yes.

Tony

On Thu, May 19, 2011 at 10:37 AM, Vangelis Kokkevis <[email protected]>wrote:

> A recurring issue with sites that want to use WebGL is that there's
> currently no good light-weight way to check whether WebGL is supported in a
> particular client. We have a couple of mechanisms in place but they all have
> drawbacks:
>
> 1. Statically check for window.WebGLRenderingContext :  This will return
> false positives, e.g. when running on blacklisted configurations, when WebGL
> is explicitly disabled via some user pref, etc.
> 2. Create a WebGL context and inspect the result : Creating a context is
> expensive (slow) and when you only need to know whether WebGL is supported
> the resulting context isn't really needed.
>
> One possible solution would be to define window.WebGLRenderingContext only
> if both the browser supports WebGL and all the blacklist / user-pref / etc.
>  tests succeed.  Current pages will have to be tweaked to report a more
> generic "WebGL is not supported on your configuration" type of message
> rather than "Your browser does not support WebGL".  If they really need to
> know why it's not supported they can go one step further and try to create
> the WebGL context and decipher any context creation error.
>
> Obviously there will still be some false positives with this mechanism but
> they will hopefully be rare.
>
> Thoughts?
>
>
> Vangelis
>
>
>
>
>


-- 
Tony Parisi                             [email protected]
CTO at Large                         415.902.8002
Skype                                     auradeluxe
Follow me on Twitter!             http://twitter.com/auradeluxe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://khronos.org/pipermail/public_webgl_khronos.org/attachments/20110519/8f4f8edb/attachment.html>


More information about the public_webgl mailing list