My GLSL shaders playground
Mandelbrot set movement controls
Keyboard
- Arrow keys (
←
,→
,↑
, and↓
) for moving around Z
andX
for zooming in and zooming outR
to reset everything to the starting point- Hold
Alt
to slow down movement and zooming and holdShift
to speed it up
Mouse
- Drag and Drop (click left mouse button and hold while moving the cursor)
- Zoom by scrolling the mouse wheel
How to run
I didn’t try and/or test it outside NixOS but technically if you install
following dependencies you can just run make run
and it should work for you:
- GCC
- GNU Make
- pkg-config
xxd
executable- GLFW3
- GLEW
- General OpenGL C header files
With Nix
Either you enter a Nix Shell and run make
commands:
nix-shell --run 'make run'
Or you can build the derivation and run it:
nix-build
result/bin/app
You can pre-build Nix development environment
(to add a GC root and prevent it from being garbage
collected unless you remove the result*
symlink):
nix-build -A env -o result-env
Known issues
GNU/Make doesn’t recognize changes in *.glsl
source files for some reason.
So if you just change a shader without cleaning the cache you actually get
previous result. I usually use touch src/main.cpp && make run
as a hack to not
clean the whole cache. Or you can use this hack for automatically recompile and
run when you save any change in a shader file:
while true; do inotifywait -e create src/shaders/** ; touch src/main.cpp && make run; done
Author
Viacheslav Lotsmanov