WebGL in WebKit nightly builds!

Well, the big news that came out overnight is Chris Marrin’s announcement that WebKit nightly builds [UPDATE: for the Mac only] now include support for WebGL! Chris is a 3D graphics guru, so as you’d expect, he’s lined up some amazing-looking demos of WebGL features. They don’t work in the current version of Firefox, but Vladimir Vukićević writes that the next one will be fine; until that’s available, but you can see them on YouTube. [UPDATE: I misunderstood what Vladimir was saying; the bugfix he put in makes Firefox more compliant with WebGL, but Chris's demos are currently WebKit-only by design. Benjamin DeLillo is working on porting them to Firefox using his own WebGLU library, however — see the comments below for details.] [UPDATE AGAIN: Jacob Seidelin has ported them over to Firefox, and they all work just fine with the latest nightly build: check them out here!]

Chris’s post also includes a whirlwind tour of the WebGL code required to texture-map a spinning cube, which I’m sure I’ll be pilfering code from in my later tutorials :-)

I’ve not been able to test it myself yet, but with some advice from Vladimir and from commenter cmarrin (who I guess is Chris) I’ve made a few compatibility changes to the examples on this site, so I think they should all work just fine… if you try them out and they don’t work, please do leave a comment.

Once I have WebKit working on my PC a Mac I’ll test the examples myself, and will also post instructions on how to install it to the Getting Started page.

You can leave a response, or trackback from your own site.

20 Responses to “WebGL in WebKit nightly builds!”

  1. When I try to run FindSafari.exe I get:
    FindSafari.exe
    This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.

    Safari itself is installed and works. Got any ideas?

  2. giles says:

    Actually, I get almost exactly the same error! For me, it says:

    >>>
    The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.
    < <<

    The application log tells me that the underlying problem is:

    >>>
    Activation context generation failed for “C:\Dev\Sandbox\WebKit-r49830\FindSafari.exe”. Dependent Assembly Microsoft.VC80.CRT,processorArchitecture=”x86″,publicKeyToken=”1fc8b3b9a1e18e3b”,type=”win32″,version=”8.0.50727.4053″ could not be found. Please use sxstrace.exe for detailed diagnosis.
    <<<

    I thought it was just my messy machine configuration, so didn’t want to post about it yet. Still, if you’re getting it too it must be a more general problem.

    Which OS are you using? I’ve tried it on Vista SP1 so far, and will check XP later on today.

  3. I got the demos running in FF nightly with just a few minor changes: http://www.nihilogic.dk/labs/webgl/webkit-demos/. Not quite the same fps numbers as in that video, though – at least not for me.

  4. giles says:

    @Jacob Seidelin cool! I currently get the error “gl.clearDepth is not a function” from both yours and the ones on the WebKit site, but I think tomorrow’s FF build will fix that.

  5. @jacob @giles, ff only supports clearDepthf at the moment

  6. However, I’m working on porting them to WebGLU, I’ve got the spinning box working @ http://bit.ly/G9J8m

  7. giles says:

    @Benjamin DeLillo clearDepthf will be dropped from FF and replaced with clearDepth in the next nightly build, apparently.

  8. Well, as far as I can tell, clearDepth seems to be working fine for me with the nightly build from october 20?

  9. giles says:

    @Jacob Seidelin that’s odd! I thought I had the October 20 build installed yesterday, and it was still using clearDepthf. Perhaps I was confused about which version I had installed on which machine… anyway, I can definitely confirm that the one that’s currently available uses clearDepth. My examples currently check which version of the function is available and use it, but I’ll remove that in a week or so.

  10. giles says:

    …of course, there’s still work for Benjamin to do in his port — the WebKit examples assume that the context is webkit-3d, and no doubt there are other compatibility problems…

  11. @giles, my port is mostly rewritten to use WebGLU library calls instead of raw WebGL. If you’re encountering errors it’d be great to know what they are.

  12. giles says:

    @Benjamin DeLillo — The spinning box works perfectly on my desktop machine; I was getting 24fps.

  13. giles says:

    OK, mystery solved — Chris pointed out (on a comment on his blog post) that the support is currently Mac-only. PC support is being tracked here: https://bugs.webkit.org/show_bug.cgi?id=30625

  14. Are the modified ones I posted above working fine for you as well?

  15. giles says:

    @Jacob Seidelin — they work, and wow, they look fantastic! Thanks for letting me know about them, I will update the post.

  16. Josh says:

    If anyone else comes across this after having issue with the side by side configuration error popping up, I was able to fix it.

    This worked for me on Vista SP1.

    1. Looked in c:\windows\winsxs\ and didn’t see an x86 copy of the assembly it complained about not having in the log.
    2. Searched and found out the offending version of the assembly went out in a security patch on 7/28/2009. Here is where you can get it: http://www.microsoft.com/downloads/details.aspx?familyid=766a6af7-ec73-40ff-b072-9112bab119c2&displaylang=en

    3. Installed that, and now FindSafari works, so it’s able to launch using the run-nightly batch file.

    Wasn’t able to check your webgl stuff, since I’m on windows.. obviously. But now I can play around with the new inspector features. wahoo.

  17. giles says:

    Hey, thanks Josh! Hopefully they’ll have WebGL in the Windows build of WebKit soon (especially since it’s working reasonably well in Chrome now), so I’ll use your instructions to get it installed when they do.

  18. Jimmy says:

    Doesn’t work well on older GPU’s. I got 2-3 FPS with the spinning earth and mars with minefield.

  19. giles says:

    Jimmy — it might be using software rendering; if your graphics driver doesn’t support OpenGL 2.0 then it probably is. You may be able to get a driver update, though TBH if you have an Intel GPU then you probably won’t.

  20. Moumita says:

    Hi,

    I have a wincairo debug version webkit build. I have done some modification in WinLauncher and Webkit core part and then build it in debug mode.

    Now I am trying to run the winLauncher exe in my another m/c but it’s not working. I have copied all the dependency files like

    CFLite.resources
    JavaScriptCore.resources
    Webkit.resources
    Cairo.dll
    Cflite.dll
    CFLite_debug.dll
    Icudt40.dll
    Icuin40.dll
    Icudt40.dll
    Icuuc40.dll
    javaScriptCore_debug.dll
    libcurl.dll
    libeay32.dll
    libxml2.dll
    libxslt.dll
    objc_debug.dll
    pthreadVC2.dll
    SQLite3.dll
    Ssleay32.dll
    Webkit_degug.dll
    WinLauncher_debug.exe

    It is giving me the error.
    “This Application has failedto start because the application configuration is not correct”.

    I am using OS -> XP in my both m/cs

    Please help me to solve this problem.

    Thanks,
    Moumita

Leave a Reply

Subscribe to RSS Feed Follow Learning WebGL on Twitter