CG Workbench
2020-12-02
Live shader coding environment with nodes.
Table of Contents
If you want to visualize your thoughts, this is the right tool.
History
During the Under Construction 2017, I’ve seen my first live shader session and I was hooked. I wanted to have similar tooling to visualize ideas for shaders really quickly and I started hacking.
Some hours later, I got my first draft done. Hacked together with C++, qmake, dear imgui and OpenGL, I had a simple shader node and a renderer node and I could create my first effects:
Features
I worked for a good amount of time on the the CG Workbench and now the feature set is quite impressive. I have nodes for rendering, audio, generic event driven programming, arithmetic computations, and many others, including hardware interfaces.
All nodes can be interconnected, also into loops. Some types like images require buffers to be passed properly over a frame boundary, but you can utilize them to create effects that work in-place.
It’s possible to create basically any linear arithmetic expression, there’s support for matrices, vectors, scalar values and so on:
The shader editor is able to compose arbitrarily complex shaders, even ones that utilize geometry shaders and tesselation stages, which can then be passed into the a renderer.
Renderers then can present either a single draw call or draw a sequence of render passes that can each have their own transform, geometry, and shader, allowing the user to compose things into scenes.
The Future
Right now, the CG Workbench is built on video timing, which is okay for visual effects. But for a precise audio events, it doesn’t work a bit. 16 ms are just way to coarse to create nice audio effects.
As I want the project to provide me an environment, where I can actually create and prototype full demos in, I need to rewrite the system from the ground up, while keeping the features I already have.
Things that might come at a point in the future:
- Precise audio-based timing
- Export of projects into standalone executables
- Scripting environment with Lua for complex control
- Sync trackers for precise control
- GNU rocket support
- Geometry nodes