01 May 2013 — by Martin Schneider

This is an overview of the features provided by various GLSL shader sandboxes running inside the browser. Note that this list only considers fragment shader sandboxes that run inside the browser and use the WebGL flavour of GLSL.

I’ll be comparing the four most popular shader sandboxes plus our own. If there is anything missing from the list please let me know!

The best choices in each category have been hightlighted, so you can immediately see which sandbox is best for your specific task.

Overview

I’ll compare the sandboxes according to four main categories:

  • Interaction
  • Computation
  • Media Input
  • Community Features

In the end I’ll provide a huge mega-matrix that puts it all together.


Interaction Compared

Let’s see how the sandboxes make use of the User interface to control shader parameters:

GLSL SandboxWebGL PlaygroundPixelShadersShaderToyNeuroVision
Mouse input6D DIY4D2D
KeyboardDIYx
GUI inputDIYYES
6DOF inputYES

Mouse Input

There are various ways to represent mouse interaction. In the most simple case (2D) only the mouse coordinates are passed as a 2D vector.

In Shadertoy 0.4 mouse coordinates are passed as a 4D vector. The first pair of components represent the mouse position, and changes continuously when the mouse is moved.
The second pair is used to code for “mouse orientation” a value that is only changed when the mouse is dragged.

The GLSL Sandbox extends this approach to 6 degrees of freedom by allowing both left- and right-drag actions. The corresponding vectors are called mouse, surfaceSize and surfacePosition.
This mapping suggests that the mouse buttons should be used to represent drag and zoom actions.
Check out this example to see it in action.

In the WebGL Playground the Programmer must provide her own code to map mouse and keyboard events to shader uniforms.

GUI Input

If there are several shader parameters it is quite convenient to control them via sliders. Neurovision is the only of the Sandboxes under comparison that allows for sliders, which can be generated from the code.

Keyboard Input

Currently none of the Sandboxes provides support for keyboard input, however its simple to implement this on the WebGL Playground.

6-Degress of Freedom Input

The Neurovision Sandbox has support for 3D Motion controllers with 6 Degrees of Freedom 6DOF.
We are currently using the Cognitive Suite of the Epoc Emotiv Brain device to control those parameters. Support for other devices such as the 3Dconnexion will be available upon request.

The Neurovision Sandbox also supports a 7th degrees of freedom corresponding to the disslove action of the Emotiv, that does not have a correspondence in the physical world.


Computation Compared

In the most simple case a shader takes some input and transforms it to a visual representation on the canvas. If the sandbox provides a memory layer or back buffer, we can access the output or the previous state of a shader. NeuroVision allows several shader layers, to be stacked, always passing the input to the next layer.

GLSL SandboxWebGL PlaygroundPixelShadersShaderToyNeuroVision
Shader Layers1DIY11unlimited
Memory Layers1DIYunlimited

Media Input Compared

Lets have a look at how the sandboxes handle images, video and sound:


Image Input

If you want to experiment with different textures and images,
WebGL Playground and ShaderToy are your best options.

GLSL SandboxWebGL PlaygroundPixelShadersShaderToyNeuroVision
Image ChannelsDIY4
Image Choices1015 + 6 Cubemaps
Image MeshupYES
Image Channels
How many images can be accessed at the same time?
Image Choices
How many images are available as input?
Image Meshup
Can you use images from the web?

Video Input

NeuroVision is the only tool that allows for video-meshups,
when running in a hacked Browser.

GLSL SandboxWebGL PlaygroundPixelShadersShaderToyNeuroVision
Video Channels41
Video Choices21
Video MeshupYES
Video Channels
How many vidoes can be accessed at the same time?
Video Choices
How many videos are available as input?
Video Meshup
Can you use videos from the web?

Audio Input

If you want to experiment with different sound reactive shaders,
ShaderToy is currently your tool of choice.

GLSL SandboxWebGL PlaygroundPixelShadersShaderToyNeuroVision
Audio Channels4
Audio Choices5
Audio Meshup
Audio Channels
How many audio tracks can be accessed at the same time?
Audio Choices
How many audio tracks are available as input?
Audio Meshup
Can you use audio from the web?

Camera Input

Camera Input is only available in PixelShaders and NeuroVision

GLSL SandboxWebGL PlaygroundPixelShadersShaderToyNeuroVision
Camera InputDIYYESYES

Coding Features Compared

In terms of coding and community features the GLSL sandbox is most advanced.

GLSL SandboxWebGL PlaygroundPixelShadersShaderToyNeuroVision
HostYESYESYES
ShareYESYESYESYESYES
ForkYESYES
DiffYES
Host
Source Code is hosted on the server vs. encoded as Link
Share
Link to the Sketch can be easily shared
Fork
Sketches can be forked, and traced back to their origin
Diff
Changes between Versions can be visualized

More Info

I hope the comparison helped you get a little overview, of what you can and cannot do with the various shader sandboxes. In general it is a good idea to pick a sandbox that is as simple as possible, but not too simple, to achive what you want to do.

Below you’ll find the links to the sandboxes, their source code, and the twitter accounts of their authors.


Sandbox PageGLSL SandboxWebGL PlaygroundPixelShadersShaderToyNeuroVision
Open SourceYESYESComing soon!
AuthorMr.Doob1Krystian Samp 2T. Schachmann 3Iñigo Quilez 4Martin Schneider 5

The Mega-Matrix

And finally the ultimate Mega-Matrix – Enjoy!

GLSL SandboxWebGL PlaygroundPixelShadersShaderToyNeuroVision
Mouse input6D DIY4D2D
KeyboardDIYx
GUI inputDIYYES
6DOF inputYES
Shader Layers1DIY11unlimited
Memory Layers1DIYunlimited
Image ChannelsDIY4
Image Choices1015 + 6 Cubemaps
Image MeshupYES
Video Channels41
Video Choices21
Video MeshupYES
Audio Channels4
Audio Choices5
Audio Meshup
Camera InputDIYYESYES
HostYESYESYES
ShareYESYESYESYESYES
ForkYESYES
DiffYES
Open SourceYESYESComing soon!
AuthorMr. DoobKrystian SampToby SchachmannIñigo QuilezMartin Schneider

  1. Mr.Doob – twitter: @mrdoob

  2. Krystian Samp – twitter: @krystiansamp

  3. Toby Schachmann – twitter: @mandy3284

  4. Iñigo Quilez – twitter: @iquilezles

  5. Martin Schneider – twitter: @bitcraftlab