- I’m sure everyone’s already seen this one, but it’s very cool indeed: Google search now does 3D graphing! WebGL.com has a list of cool functions to try out. (h/t Mr.doob)
- A great tutorial in .NET magazine from Paul Lewis — “Create an interactive liquid metal ball with WebGL“. If your taste in interactive liquid metal things tends more to monkies, Paul has that covered too.
- Paul Lewis has also written a great tutorial on using environment maps, which inspired this wonderful WebGL/Google Street View mashup from Jaume Sánchez Elias.
- While we’re looking at reflection mapping demos, here’s one from Mr. doob and one by both him and Jaume Sánchez Elias.
- Confused by WebGL’s plethora of blending options? Here’s some help from AlteredQualia.
- Chris Dzombak has put together some “[i]nitial really ugly and hacky visual realtime diffs of audio files with WebAudio and WebGL”. There are two demos, song vs clicktrack and song vs song+clicktrack. They take a little while to load the audio and there’s no indicator (yet?), so be patient.
- Some more entries in the 3D content-sharing and creation space, joining OurBricks and SketchFab (which, by the way, now has a nice model-embedding feature):
- “GlowScript is an easy-to-use, powerful environment for creating 3D animations and publishing them on the web.” (h/t Bruce Sherwood)
- sunglass.io is a more fully-featured 3D design tool that also allows you to share your workspace with other people as you build your content.
- BlendSwap, a place for Blender artists to share their work, now also has a WebGL preview of some of the models. (h/t AlteredQualia)
- WebGL Up and Running by Tony Parisi (published by O’Reilly) should be released in July. I’m currently reading a draft and it’s looking great!
- Cool: Nokia’s 3D maps now has a version you can view with red-blue 3D glasses (h/t The Verge)
- Einar Öberg’s lathe is quite a nice little Three.js demo.
- Also Three.js is Manny Tan’s disc experiment; he’s blogged about it here.
- Morten Nobel-Jørgensen created the KickJS game engine (mentioned here before); here’s his master’s thesis, which uses it as an example.
- Want to run WebGL in Firefox even though your driver’s blacklisted? It may well not work anyway, but here’s instructions on how to ignore the blacklist, from Craig Buckler. (via HTML5 Game Dev News.)
- If you’re still stuck with outdated drivers, you’ll be happy to know that Chrome 18, which uses the SwiftShader library to render WebGL in software on your CPU — more slowly than on the graphics hardware, but still impressively well — is now the official stable release. I believe SwiftShader is still only enabled on Windows, though.
- And, of course, you can always ignore the GPU blacklist on Chrome with command-line flags:
--enable-webgl --ignore-gpu-blacklist - More good stuff over at WebGL.com this week:
- G-code is a language used to command 3D printers, and Joe Walnes has written a WebGL viewer so that you do a print preview…
- Milkshake, a WebGL music visualiser from Matt Gattis — sadly it seems to use Flash for the audio.
- MagicCube is a Rubik’s cube simulation developed to demo the Oak3D framework.
- Progressive Fractal from Felix Woitzel is strangely attractive.
- Christian Wannerstedt’s Line Dance is (luckily) not at all what I expected from the name
His Plane Deformation demo is also worth a look — demoscene-style shaders.
- More demoscene stuff, this time from Frank Reitberger: Artificial.
- Cockpit.js puts a simple Cockpit overlay onto a web page, and Jens Arp has overlaid it on top of a Three.js spaceflight demo for a nice effect.
- A cool — well, hot — fireball from AlteredQualia.
- If you’re on the lookout for even more sources of cool new WebGL demos, over on the webgl-dev list, Theo Armour points out that there are subreddits for WebGL generally and Three.js specifically.
Got a WebGL site you’d like to see in next week’s roundup? Leave a comment below!




Here are details of how to do transparency in WebGL using depth peeling:
http://www.khronos.org/message_boards/viewtopic.php?f=44&t=4905
And mouse picking is treated in detail in a response to this post:
http://www.khronos.org/message_boards/viewtopic.php?f=44&t=4899
I should clarify something, not necessarily for your blog but for your own information. You comment that in comparison with GlowScript (glowscript.org), “unglass.io is a more fully-featured 3D design tool that also allows you to share your workspace with other people as you build your content.” This is comparing apples and oranges, but I sympathize with your impression, because even technically strong friends sometimes have a hard time wrapping their heads around what GlowScipt is about. Your blog is aimed at people who are developing WebGL applications, and who necessarily have very high programming skills. Who GlowScript is for is the novice or occasional or nonexpert programmer who needs to create an algorithmically/program based 3D animation, as distinct from using some kind of 3D design tool — people who have the skills to write mathematical algorithms but most definitely do not have the background, time, or inclination to fight their way through something as highly complex as WebGL or OpenGL. The potential users of GlowScript (JavaScript + WebGL) are the same people who use VPython (Python + OpenGL; vpython.org). They include scientists and engineers, and students in computational science courses. GlowScript is really not much like any other WebGL application known to me, as it is an environment within which programmers can use WebGL productively without needing to know anything about WebGL. What may be of interest to implementers of WebGL applications are some of the techniques being deployed in GlowScript, including depth peeling to support transparency, and the details of mouse picking, which is why I’ve just posted descriptions of these schemes.
@Bruce
Note that glowscript uses the GC to allocate things which is the reason why it has a studdering frame every 2 or so seconds. The GC cycle in browsers usually consumes something between 180-250ms of time which is unfortunately very user noticable.
Another thing I noticed is that glowscript is generally slow (a simple scene runs at only 25fps on my machine which has a gtx-460 in it).
I’m ignorant: what’s a GC? Perhaps from not knowing what to look for I haven’t seen the pauses you describe. For moderately complex scenes with a GT 240 I see 60 fps, such as this 10×10x10 grid of rotating boxes:
http://www.glowscript.org/#/user/GlowScriptDemos/folder/Examples/program/RotatingCubes
What is the example where you see low frame rate?
Bruce, GC = garbage collection. Browser vendors are working towards avoiding long GC pauses, but that work is still ongoing.
Thanks. I should have figured that out for myself. I’m unaware of what alternative there is to the automatic garbage collection. GlowScript runs in a strict mode that requires “var”, so there aren’t globals to be garbage collected. There is use of “new”, not always paired with an explicit delete. Is it considered good practice to be scrupulous in the use of delete? Or to avoid new? Is the “stutter” that I haven’t noticed a feature/bug of GlowScript or a general problem that’s being worked on?
Delete does not delete anything, it merely removes the name from the closure or object it refers to.
“new” comes in many forms, those are: [], {}, new and function(){}
The key to avoiding GC stuttering is to avoid allocating things during a running loop (i.e. in the draw callback, physics callbacks, etc.).
Any allocation, any lists, objects, explicit objects with new and function bodies will all pile up on the GC. Integers and strings are mostly ok, it would seem that they get shortlisted by GC because they are immutable and cannot refer other objects.
The alternative to allocating things is pre-allocating them, so you don’t have to during the runtime. Among other things it means you will have to use a stilted way to deal with vectors in order to avoid copying semantics on vector-ops. You will also have to avoid building dynamic structures of anything that you can’t stick in fixedly allocated lists, objects or typed arrays.
Thanks much, Florian, for the concrete advice. Two specific questions: 1) Are you saying that upon exit from a subroutine local variables and functions are not deleted? For example, should most functions and variables be moved outside of the main render function? 2) What specifically did you have in mind when you said, “Note that glowscript uses the GC to allocate things”? (I had assumed that all JavaScript programs used the GC to allocate things.)
I just realized something, Florian, about seeing a low frame rate. While it is of course easy to write a GlowScript program that is sluggish, it’s possible that you viewed a demo which has a deliberately chosen low frame rate. A GlowScript option lets you specify no more than N iterations of an animation loop per second, so that an animation will run at the same speed on all computers (that is, all computers fast enough to do N iterations per second). It’s a clamp.
@Bruce
1) At exit from a subroutine is a slightly wrong term for JS. In JS each function is a closure, that’s embedded in a stack of closures. From within that closure all upscope closures can be accessed. A function body in JS is more like a special kind of object because it can have references to other things which survive the lexical scope of the closure. A typical case for this is:
f = (function(){ var a=1; return function(){console.log(a++)} })();
f() –> 1
f() –> 2
Likewise JS does not really have variables, closures keep named references to objects (numbers, strings, lists, objects and other closures). If an object is no longer referenced it is going to be deleted at some point (at the next GC collection cycle).
2) Using the GC to allocate things means that you’re using either of these inside of your drawing loop: obect: “{}”, list: “[]“, explicit object: “new Anything” and function: “function(){}”.
A typical piece of code doing this would be:
var draw = function(delta){
physics.step({
delta: delta,
onCollide: function(){ … }
}}
}
This allocates one object (via object literal) and one closure object via function definition per frame.
You will have to rewrite this to
var onCollide = function(){ … }
var draw = function(delta){
physics.step(delta, onCollide);
}
New WebGL demo “Radiotherapy” by Alcatraz & Scoopex released at revision demoparty:
http://pouet.net/prod.php?which=59133
(created with Inka3D)
@Bruce — many thanks for the clarification! FYI I’m not getting a GC judder on my Windows Vista machine using Chrome, so there’s presumably browser or OS dependence in how much of an issue this is. You might find this article from last week’s roundup useful, though: Brandon Jones on Javascript memory optimization and texture loading
@Jochen_0×90h — thanks! I’ll put that in this week’s roundup.