Scriptable Video Module

Sure! It took me a while to figure everything out - so here is a short guide in case more people are interested.

I’m running shader files with glslViewer on Raspberry Pi OS Lite (Buster). With this configuration you only have a command line interface (and the glslViewer window) so no resources are wasted on the windows manager.

From the command line, shaders can be run full screen like so:

glslViewer shader.frag

How to get there:

SSH
I find it easy to SSH into the Pi, because then you can easily copy/paste shader code from your main computer.

Prepare the image
Using the imager prepare Raspberry Pi OS Lite (Legacy - Buster).

In the imager, use shift+cmd+x (or similar depending on your OS) to show the advanced options. Make sure the hostname is set and SSH is enabled, and configure wifi.

Compile glslViewer
After booting up the Pi, follow the steps here - if you are on OS Lite, you need the steps for no X11.

On the compile step, use the following make command:

cmake -DNO_X11=TRUE -DFORCE_GBM=TRUE ..

(the manual reads as if you should use either one of the arguments, but you should use both)

Configuration
In the final step of the previous section you are told to make sure some lines are uncommented in the /boot/config.txt file. In addition to those lines, make sure to have the this uncommented as well (to enable the composite video out):

sdtv_mode=2

And you can set a smaller frame buffer size, which should improve performance:

framebuffer_width=320
framebuffer_height=240

Finally run

sudo raspi-config

And under ‘Advanced options’ set the GL Driver to G2 GL (Fake KMS).

Test
Reboot the Pi and you should be ready to go. Some examples are included in the glslViewer repo.

Reference to the test pads.

5 Likes

Btw I took the cellular shader from here as a quick test.

3 Likes

That specific pattern looks like a Voronoi.
Here’s a tutorial for generating them in a glsl shader. The Pi’s GPU isn’t powerful enough to smoothly animate that many cells using this algorithm.

it would be cool to create a small instrument with a few controls on it.

one composite output and a few pots and buttons for adjusting variables
I was thinking about these types of noise, indeed
but I have no experience with the Pi yet.
maybe a collaberation with someone?

4 Likes

There is already the r_e_c_u_r project. There is an i_n_c_u_r add on that gives you four pots and CV inputs for them.
There is also a chap called Erik Oostveen that has been posting on the Facebook Video Circuits group who is also doing a similar PI based shader project called SlimShader.

yes, I know that one. it is still on my “to do” list!
I was thinking more in the line of really simple shader source to be used as grayscale input into the LZX enviroment, without menu’s and/or interface. Just like 4 pots to adjust specific variables.

and it might be a fun way to get started with the Pi :slight_smile:

2 Likes

Count me in :slight_smile: for collaborations on that.

1 Like

cool!

It can even be a module with a Pi on the back, I realize now.
I don’t know which limitations there are for this type of applications, but anything really is cool.

Last year I tested grayscale gradient inputs with a standalone player, which was already very useful (but a bit unwieldy to use. (and premade, so no realtime control)

Pi zero draw less current than the rest, it’s less powerful as well, but for some simple shapes it could work.
They eat a lot of amps generally

That makes sense. That’s how I use r_e_c_u_r and Structure most of the time, as if I take them straight into the Cortex, they are mono, anyway…
I would have thought that you would want to be able to switch between shaders, though.
I’d like to learn more about how to do this.
I’m also interested in learning how to make greyscale 3D terrains on an embedded device like the Pi. I’m not sure whether the Pi would be powerful enough to do this in GLSL, but I would have thought that it could handle simple mesh deformations.

I know at least one person is working on a device such as this (lo power, small pi board, composite, glsl etc…

EDIT: not sure if linking to a patreon is ok (it isn’t ours although we have backed them for a while)

1 Like

that would be cool, indeed!

That’s very close to what the recurBoy is. Though it still has a (small) screen.

@Marizu actually it is! See below - by the way, the Pi is not overclocked.

Here are some more examples to show the performance:

Or an adaptation of this shader on the Pi

vs on Structure

And finally a heavy one:

2 Likes

@reverselandfill this is what I was going for, the ideal texture/movement input module. Should not be too difficult to add some buttons to cycle through a list of shader files, and some basic controls.

@creatorlars regarding your earlier comment, you are right it’s pretty limited in terms of modular I/O. But for me personally, the goal would be to make a module as small and simple as possible. I mainly want to use it to add some depth and continuity to my patches and have a bit less repetition (like with oscillations and one-way movements).

I don’t think I’d want to play with this a lot anyway during performance, because there are lots of other modules for that. Also, most of the time spent with such a shader module would be on creating the shaders so you have them exactly how you want. That’s why I wouldn’t mind not being able to mix it, for example.

For people that are not into making the shaders themselves, there should be a shader selection available which is based on utility and compatibility (not so much visually pre-defined and obviously shaped). I’d be happy to share my personal utility shaders at some point if it can help with a module (@reverselandfill).

What I miss is something subtle and universal. Structure is awesome, but it sometimes feels like you are picking samples from a VJ loops package. Of course you can add your own shaders, but for just running one simple shader it’s a bit overkill (in terms of price and HP).

It’s more about the video synchronization side of things – you can’t get the CVBS output of the Pi to output a video signal that will be synchronous with the rest of your patch, in the LZX 1V context anyway. You’d need to patch in via a TBC module or mix externally with a video mixer (which adds cost.)

Maybe this can be circumvented – we’ve looked into it before, but getting an external video rate clock source into the Pi is pretty closed off. If it could be solved, it would make some really useful functions (like small, dedicated modular shader engines) very accessible.

Of course, the project is worth pursuing even if video sync isn’t achievable!

but patching it in the Cadet I & III will work, right?

yes, that is exactly what I was thinking

a simple module with a video output , some controls and the possibility to read shaders
(adjusted to be manipulated by those controls, if that is possible)

cheap, small and fun!

2 Likes

Yes of course! My point was just that you can’t have multiple pi based shader units in sync with each other. So you’re just limited to one shader unit. Which is awesome of course, but not nearly so powerful as it would be to have several of them, and be able to mix their outputs seamlessly in-system.

1 Like

I get it now :slight_smile:
if there would be one such module, you can’t have 2 in your system… (without external processing)

but one is already pretty fun I’d image

2 Likes