Loading...

GLSL Shader Sandbox on the Raspberry Pi

4,451 views

Loading...

Loading...

Loading...

Rating is available when the video has been rented.
This feature is not available right now. Please try again later.
Published on May 13, 2012

A way to quickly write and experiment with GLSL fragment shaders on the Raspberry Pi, trying to emulate the excellent sandbox at http://glsl.heroku.com (as far as is sensible.)

To use, clone/copy the repo at https://github.com/benosteen/pyopengles and copy this to the Pi.

$ sudo apt-get install python-inotify
(install a lib needed to watch a file for changes)

Then:
$ cd pyopengles
$ bash glsl_sandbox.sh leds.glsl
(This uses the nano editor to edit the shader. Ctrl-o then Enter to save your changes, Ctrl-X to quit.)

The shader display should reload any time you save a change to the file (no display = shader error.)

The shader is passed three variables:
- "mouse" (vec2)- mouse position (if mouse is plugged in),
- "resolution" (vec2) - screen resolution
- "time" (float) - a time variable.

If you start it with a non-existent filename, it will create a new one and pre-fill it with the default template shader (from default.template.glsl)

Loading...

When autoplay is enabled, a suggested video will automatically play next.

Up next


to add this to Watch Later

Add to

Loading playlists...