How to use shady with ledcat

shady is a CLI tool to render GLSL shaders.

ledcat is a tool to control lots of LED's over lots of protocols.

ledcat is also a script within the rpi-rgb-led-matrix library, used to display animations on RGB-LED displays.

I use shady with rpi-rgb-led-matrix/ledcat to display animations on my LED-Cube.

1. Install shady

Follow the instructions given in how-to-install-shady-in-raspberry-pi4.

polyfloyd/ledcat :

2. Install :

$ wget https://github.com/polyfloyd/ledcat/releases/download/v0.2.0/ledcat-armv7-unknown-linux-gnueabihf.tar.gz
$ tar -xzf ledcat-armv7-unknown-linux-gnueabihf.tar.gz
$ ./ledcat

3. Test :

see https://github.com/polyfloyd/shady/issues/14

$ export LEDCAT_GEOMETRY=64x64
$ export EGL_PLATFORM=surfaceless
$ export MESA_GL_VERSION_OVERRIDE=3.3

$ shady -i example.glsl -ofmt rgb24 -g 64x64 -f 20 | ledcat -f 20 show

Note : in the above example, the -f 20 parameter must be specified for both commands.

# GPIO for Adafruit RGB Bonnet : 
$ shady -i example.glsl -ofmt rgb24 -g 64x64 \
    | sudo ledcat --geometry 64x64 hub75 --level-select 22,26,27,20,24 \
        --red 5,12 --green 13,16 --blue 6,23 --clock 17 --latch 21 --output-enable 4

$ shady -i example.glsl -g 64x64 -f 20 -ofmt rgb24 \
    | sudo ledcat --led-rows=64 --led-cols=64 --led-slowdown-gpio=4 --led-show-refresh \
        --led-pwm-bits=11 --led-pwm-lsb-nanoseconds=100 --led-brightness=80 --led-rgb-sequence RBG

rpi-rgb-led-matrix/ledcat.cc

Install :

$ git clone https://github.com/hzeller/rpi-rgb-led-matrix.git
$ cd rpi-rgb-led-matrix/
$ make

Test :

$ cd examples-api-use/
$ sudo ./demo --led-rows=64 --led-cols=64 --led-gpio-mapping=adafruit-hat --led-slowdown-gpio=5 -D 0
$ cat /dev/random | sudo ./ledcat --led-rows=64 --led-cols=64 --led-gpio-mapping=adafruit-hat --led-slowdown-gpio=5

with shady :

$ shady -ofmt rgb24 -g 64x64 -f 20 -i ~/projects/shady/shaders/example.glsl \
    | sudo ./ledcat --led-rows=64 --led-cols=64 --led-gpio-mapping=adafruit-hat --led-slowdown-gpio=5

note: param -f 20 is mandatory