Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gromnitsky/gtk4_shadertoy
A desktop shadertoy renderer that runs standalone shaders without a web browser. Can be used as a live wallpaper under X11.
https://github.com/gromnitsky/gtk4_shadertoy
gtk4 shadertoy
Last synced: about 6 hours ago
JSON representation
A desktop shadertoy renderer that runs standalone shaders without a web browser. Can be used as a live wallpaper under X11.
- Host: GitHub
- URL: https://github.com/gromnitsky/gtk4_shadertoy
- Owner: gromnitsky
- Created: 2023-06-28T21:30:07.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-11-17T00:42:30.000Z (about 1 year ago)
- Last Synced: 2023-11-17T02:29:27.820Z (about 1 year ago)
- Topics: gtk4, shadertoy
- Language: GLSL
- Homepage:
- Size: 512 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![](demo.png)
Run in a window:
$ gtk4_shadertoy test/data/afl_ext/very-fast-procedural-ocean.glsl
Right click for menu or
kbd | desc
----------------- | -------------
f | fullscreen
r | toggle an FPS overlay
esc | close window
space | pause
ctrl-o | open another shaderRun fullscreen (-f) and show the FPS overlay (-r):
$ gtk4_shadertoy -fr < file.glsl
Put the app on the lowest window layer (X11 only), ignore kbd/mouse input:
$ gtk4_shadertoy -fr -b file.glsl
To exit the app in such a wallpaper mode, you'll need to kill it
either sending WM_DESTROY, or via the TERM signal.To make the wallpaper mode work in fvwm3, add to ~/.fvwm/config:
~~~
Style * EWMHUseStackingOrderHints
Style gtk4_shadertoy_below WindowListSkip
~~~or, by just
Style gtk4_shadertoy_below StaysOnBottom, Sticky, WindowListSkip
## Features & limitations
* a tiny gtk4 app;
* no web browser dependency;
* remote control via a socket;
* `-b` option crashes the app in Wayland;
* renders only a subset of standalone shaders so far, i.e., if a
shader depends on a texture specific to shadertoy.com it won't
work.## Compilation
* Fedora:
$ sudo dnf install gtk4-devel
* Ubuntu:
$ sudo apt-get install libgtk-4-dev
then
~~~
$ make
~~~`_out/gtk4_shadertoy` should be the result.
## Advanced control
Run in a window, but also accept commands via a socket:
~~~
$ gtk4_shadertoy test/data/TAKUSAKU/fire-glass.glsl -p 2023
** Message: 13:56:58.520: Listening on localhost:2023
~~~Then,
~~~
$ telnet 127.0.0.1 2023
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
help
200 help; available commands: pause, load file.glsl, quit
pause
200 pause
pause
200 pause
load ~/lib/software/alex/gtk4_shadertoy/test/data/Kali/star-nest.glsl
200 load
quit
200 quit
Connection closed by foreign host.
~~~Remote controlling using netcat:
~~~
$ echo load ~/some/file.glsl | nc 127.0.0.1 2023
200 load
~~~A madness tour:
~~~
$ while :; do
echo load `find test/data -type f | shuf | head -1` | nc 127.0.0.1 2023
sleep 4
done
~~~You can add the `echo load ...` line to a crontab.
## Fetching a shader without an API key
~~~
$ npm -g i json
$ ./shader_fetch tsBfDw | _out/gtk4_shadertoy
~~~or
$ ./shader_fetch https://www.shadertoy.com/view/tsBfDw | _out/gtk4_shadertoy
## License
MIT for `gtk4_shadertoy.c` & `x11.[ch]`.
`gtkshadertoy.[ch]` are ripped from gtk4-demo app and are LGPLv2.1+.
`test/data/*` files are downloaded form shadertoy.com.