#glsl-shader #shader #glsl #creative #shadertoy #vertex-shader

app grimoire

grimoire is a cross-platform live-coding tool for creating GLSL shader demos

3 unstable releases

0.2.1 Mar 22, 2019
0.2.0 Mar 10, 2019
0.1.0 Jun 18, 2018

#784 in Graphics APIs

MIT/Apache

165KB
3.5K SLoC

grimoire   BUILD-img CRATES-img MIT-img APACHE-img

What?

grimoire is a cross-platform (Windows, MacOS, "Linux") live-coding tool for creating GLSL shader demos in the style of shadertoy and vertexshaderart. Users write a TOML configuration file that defines resources (image, video, audio, webcam, 3D texture, kinect data) and render passes (vertex shader, fragment shader, primitive type and count, blend state, depth state, uniform samplers). Your shaders, resources, and config file are watched for changes and are live updated at runtime. See the examples below to get started or read the SPEC.md for a detailed description of the configuration schema and runtime behavior.

grimoire is my personal prototyping tool and is in the early stages of development. You may encounter bugs and features may change without notice. Do not expect support. With that out of the way, I think you will find grimoire an easy to use, robust, and powerful tool for prototyping shader effects. Feedback is welcome!

examples: shadertoy compatibility

The following shaders demonstrate compatibility with various shadertoy features. All content is copyright by the original author and licensed under the terms specified, or by the default shadertoy license. If you do not want your work included in this list, you can contact me and I will remove it immediately.

Install

You need to build and install grimoire from source using rust and install the required system dependencies:

  • SDL2 for window and input handling
  • GStreamer for video, webcam, audio, microphone, and kinect2 inputs
  • OpenGL 3.3+, but uses a subset of OpenGL accessible from GLES 3.0

grimoire currently builds against rust stable 1.33, 2018 edition.

MacOS

$ curl https://sh.rustup.rs -sSf | sh
$ brew install sdl2 gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav

If running on MacOS 10.14 (Mojave), be sure to manually copy Info.plist to target/debug or target/release before running a demo that uses a webcam or microphone resource. The presence of this file allows MacOS to prompt for permission to access the camera and microphone.

Linux

$ curl https://sh.rustup.rs -sSf | sh
$ apt-get install libsdl2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav

Windows

  • Download and run msys2
  • Use the x86_64-pc-windows-gnu toolchain: rustup default stable-x86_64-pc-windows-gnu
  • Install the required dependencies /w pacman
$ pacman -S mingw-w64-x86_64-pkg-config mingw-w64-x86_64-SDL2 mingw-w64-x86_64-GStreamer mingw-w64-x86_64-gst-plugins-base mingw-w64-x86_64-gst-plugins-good mingw-w64-x86_64-gst-plugins-bad mingw-w64-x86_64-gst-plugins-ugly mingw-w64-x86_64-gst-libav
  • Manually copy the SDL2.dll to the top-level grimoire source directory (the one containing Cargo.toml) before running

Note that you need to ensure that your PATH contains the mingw64/bin directory, and that your PKG_CONFIG_PATH lists the directory containing all the .pc files. Since I installed msys2 with scoop, my .bash_profile contains the following lines:

PATH="$PATH:/c/Users/jshrake/scoop/apps/msys2/current/mingw64/bin"
PKG_CONFIG_PATH="/c/Users/jshrake/scoop/apps/msys2/current/mingw64/lib/pkgconfig"

Breadcrumbs:

Resources

fragment shaders

vertex shaders

Inspiration

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~42MB
~766K SLoC