ScGraph

SourceForge.net Logo


ScGraph is now hosted at http://sf.net
The project page is here: http://sf.net/projects/scgraph


A 3D graphics server for SuperCollider


About

In May 2007 i completed my studies of Computer Science (naturwissenschaftliche Informatik) at the Neuroinformatics group of the Faculty of Technology of the University of Bielefeld by handing in my diploma thesis. The subject of the thesis was “Design and Implementation of a 3D Graphics Server”. I was tutored by Till Bovermann, Thomas Hermann und Helge Ritter. In the course of the thesis i have developed ScGraph (short for “SuperCollider Graphics Server”).

Introduction:

The main idea was to apply the SuperCollider Server/Client architecture and usage paradigm to the domain of 3D graphics. Simply put (for those familiar with SuperCollider): Instead of

{SinOsc.ar}.play

we wanted to be able to do:

{GCube.gr}.play

As a means to spawn a synth that outputs a 3D representation of a Cube (”gr” here means “graphics rate”). To reduce the implementation effort we decided to reuse the existing SynthDef (and related) classes. The SynthDef format and the OSC protocol of the graphics server is mainly unchanged from the original SuperCollider framework. In the graphics server graphics processing takes the place of audio rate processing, but keeping control rate processing.

Actually, our example was a bit more involved:

  1. (
  2. SynthDef (\WobblingCube,
  3. {
  4.         var source;
  5.         source = GCube.gr (size: SinOsc.kr(freq: 0.5));
  6.         Out.gr(source);
  7. }).play;
  8. )

This example shows how the original SuperCollider control rate units are still usable (”SinOsc.kr” creates a control rate instance of the SinOsc unit). A cube is produced that changes its size periodically with a frequency of 0.5Hz.

Actually above example wouldn’t produce anything visible yet. One major difference between ScGraph and ScSynth (the SuperCollider audio synthesis server) is that graphics buses, contrary to audio buses, are not connected to the equivalent of a soundcard. To see anything a special unit needs to be created: GGLRenderer. Here’s a more complete example that actually produces a window on the screen with some animated graphics in it:

  1. (
  2. SynthDef (\WobblingCube,
  3. {
  4.         var source;
  5.         source = GCube.gr (size: SinOsc.kr(freq: 0.5));
  6.         GGLRenderer.gr(source);
  7. }).play;
  8. )

Features:

- Should build on Linux as well as Mac OS X (the mac port still has some issues)
- SuperCollider OSC protocol (partly implemented)
- SuperCollider SynthDef format
- SuperCollider plugin loading to make use of control rate units
- Support for geometry producing/consuming units (GUnits)
- OpenGL rendering (although different renderers should in practice be possible to implement)
- Lighting
- Blending
- Textures (preliminary, hack’ish)

TODO’s:

- Optimization (too many copies are made at the moment due to the flexible routing possibilities)
- Completion of SC-OSC protocoll (there are some commands still missing)
- Buffer support
- Improve texture support (via Buffers maybe?)
- Extend SynthDef format to support strings, geometry, etc.
- Fix up the GServer/GServerOptions classes

Patches welcome.

Screenshots:

What’s a program website without screenshots? So here we go (click on the thumbnails to get the full view):


cubes2

scgraph_wiggling_blurred_cubes.png


License:

ScGraph uses the GNU General public license (GPL) version 2.

Downloads:

You can find OLD release tarballs of ScGraph in this directory

NEW releases will be found at the sourceforge.net project page: http://sf.net/projects/scgraph

Requirements:

- A pretty recent SuperCollider installation including the development files (see scons -h in the SuperCollider source for how to do this)
- Qt4
- GraphicsMagick++
- OSCPack
- Boost libraries
- Jack/FFTW3 (only needed for the FFT unit FreqAmp)

Installation:

See the included INSTALL file for installation instructions.

Documentation

Use the source, Luke ;) Simply have a look into the $(PREFIX)/share/scgraph/sclang directory to see what classes are available.

SVN:

SVN access is possible through the sourceforge.net site (see link at top of this page).

4 Comments

  1. thor says:

    Hi Florian

    I’m dying to try out your 3D server for SC.

    I’m on a Mac and extremely busy + not very good at compiling binaries.

    Is there a chance that you make a binary of the server?

    thor

  2. Kurye says:

    Güzel Makale. Teşekkürler. Thanks…

  3. Morton Shumway says:

    You might want to delete some of the spam in the comments …

    I just have a basic question: can the data from the graphic server be easily used as input to sound generation, like sonifying porperties of a rotating cube?

    Thanks a lot!

  4. florian schmidt says:

    Morton. That is not possible per se. But since you can control both the ScGraph and the supercollider server from the same SCLang instance, it should be rather easy to produce audio/video that has some relation

Leave a Reply