Create evolving artistic images with hot-code-reloaded Lisp and GLSL.

Overview

shadergarden

Shadergarden is a tool for building hot-code-reloadable shader pipelines. For a tutorial for how to get started, consult the introductory blog post or the shadergarden lisp language documentation.

Usage

Once you've installed shadergarden via cargo install shadergarden, test to see that it is installed properly by running:

shadergarden --help

This should print out some usage information. To create a new project, run:

shadergarden new path/to/project

This will create a new example project in the specified directory. To run a shadergarden, cd into the directory of a project and run:

shadergarden run

This should open a new window and start running your graph. Don't close the window if you want to make changes; instead, open the project in an editor of your choice - the graph will update on save.

If a build error is encountered while reloading, shadergarden will log the error and continue executing the old graph.

Fancier Usage

You can pass input images and videos to shadergarden using the -i flag. This flag takes a list of paths to photos/videos - you must pass the same number of input photos/videos as the number of (input ...)s specified in shader.graph.

Once you've got a nice shadergarden, to render out a png sequence, use the render subcommand. This subcommand works exactly the same as run, but requires an output directory. To render the game of life demo out into a gif, run:

mkdir out
shadergarden render demos/life -o out -s 30 -e 430
ffmpeg -i "out/frame-%4d.png" -framerate 30 life.gif

You should see something like this (it might be a little fancier):

Happy hacking!

Comments
  • Build failed on Windows 10

    Build failed on Windows 10

    Build fails on Windows 10 during installation

    Steps to reproduce

    cargo install shadergarden

    Result

     Updating crates.io index
      Downloaded shadergarden v0.2.0
      [...]
      Compiling ffmpeg-sys-next v4.4.0
    
    error: failed to run custom build command for `ffmpeg-sys-next v4.4.0`
    
    Caused by:
      process didn't exit successfully: `C:\Users\ch\AppData\Local\Temp\cargo-installwMnxXw\release\build\ffmpeg-sys-next-b34b3bdb9c46bf88\build-script-build` (exit code: 101)
      --- stdout
      cargo:rerun-if-env-changed=LIBAVUTIL_NO_PKG_CONFIG
      cargo:rerun-if-env-changed=PKG_CONFIG
      cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
      cargo:rerun-if-env-changed=PKG_CONFIG_PATH
      cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
      cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-gnu
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_gnu
      cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
      cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
    
      --- stderr
      thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Command { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"libavutil\"", cause: Os { code: 2, kind: NotFound, message: "Das System kann die angegebene Datei nicht finden." } }', C:\Users\ch\.cargo\registry\src\github.com-1ecc6299db9ec823\ffmpeg-sys-next-4.4.0\build.rs:701:14
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    warning: build failed, waiting for other jobs to finish...
    error: failed to compile `shadergarden v0.2.0`, intermediate artifacts can be found at `C:\Users\ch\AppData\Local\Temp\cargo-installwMnxXw`
    
    Caused by:
      build failed
    
    opened by carstenheisterkamp 18
  • Make ffmpeg an optional dependency

    Make ffmpeg an optional dependency

    This makes ffmpeg an optional dependency (enabled by default) so that shadergarden is easier to install on more platforms. This should work as a temporary solution to #9; the tradeoff is not being able to pass input into graphs.

    opened by slightknack 1
  • Fix raymarch render.frag on MacOS

    Fix raymarch render.frag on MacOS

    @slightknack please review

    I tried running every demo on an intel macbook (MacOS 11.5.2). Only the raymarch demo didn't work but it only required a few changes to work.

    • A #version 140 was needed at the top of render.frag
    • out vec4 out_color; is used instead of gl_FragColor
    • A local variable box was defined, which clobbered the box function and gave compiler errors when trying to call box() further down the line.
    opened by bschwind 1
  • Public release checklist

    Public release checklist

    • [x] Upstreamed glium PR is cut into release, see https://github.com/glium/glium/pull/1956#issuecomment-913591646
    • [x] Create an initial release version and tag on GitHub
    • [x] cargo publish
    • [x] Change repo visibility to public
    • [x] Publish blog post
    opened by mcginty 0
  • macOS (M1): AGX limit exceeded warning

    macOS (M1): AGX limit exceeded warning

    $ shadergraph run
    [info] Built initial graph
    [info] Starting...
    AGX: exceeded compiled variants footprint limit
    

    The application doesn't crash, and I didn't notice any specific issues, so it may just be a spurious issue that works itself out.

    opened by mcginty 2
Releases(v0.2.0)
  • v0.2.0(Sep 8, 2021)

    This release addresses a few comments brought up after the initial release. The largest issue was the working title shadergraph, which we've decided to rename to shadergarden.

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Sep 7, 2021)

    This is the initial release of shadergraph; currently supports glium as a backend. See the README or the blog post for more info! Can be installed with cargo via cargo install shadergraph

    Source code(tar.gz)
    Source code(zip)
Create ctags/etags for a cargo project

rusty-tags A command line tool that creates tags - for source code navigation by using ctags - for a cargo project, all of its direct and indirect dep

Daniel Trstenjak 367 Dec 21, 2022
Cargo command to create the README.md from your crate's documentation

Cargo rdme Cargo command to create your README from your crate’s documentation. Installation You can install cargo rdme with cargo by running cargo in

Diogo Sousa 42 Dec 24, 2022
Create target folder as a RAMdisk for faster Rust compilation.

cargo-ramdisk This crate is only supported for unix like systems! cargo-ramdisk creates a ramdisk at the target folder of your project for ridiculousl

PauMAVA 20 Jan 8, 2023
Rust Code Completion utility

Racer - code completion for Rust RACER = Rust Auto-Complete-er. A utility intended to provide Rust code completion for editors and IDEs. Maybe one day

null 3.4k Jan 4, 2023
Format Rust code

rustfmt Quick start On the Stable toolchain On the Nightly toolchain Installing from source Usage Running cargo fmt Running rustfmt directly Verifying

The Rust Programming Language 4.8k Jan 7, 2023
compile rust code into memes

cargo-memex Besides their size, rust binaries have a significant disadvantage: rust binaries are not memes yet. cargo-memex is a cargo subcommand that

Matthias Seitz 243 Dec 11, 2022
Detects usage of unsafe Rust in a Rust crate and its dependencies.

cargo-geiger ☢️ A program that lists statistics related to the usage of unsafe Rust code in a Rust crate and all its dependencies. This cargo plugin w

Rust Secure Code Working Group 1.1k Dec 26, 2022
The Git Commit Message and Changelog Generation Framework :book:

git-journal ?? The Git Commit Message and Changelog Generation Framework Table of contents: TL;DR Installation Usage Default output Template output Co

Sascha Grunert 551 Jan 4, 2023
⚙️ Workshop Publishing Utility for Garry's Mod, written in Rust & Svelte and powered by Tauri

⚙️ gmpublisher Currently in Beta development. A powerful and feature-packed Workshop publisher for Garry's Mod is finally here! Click for downloads Ar

William 484 Jan 7, 2023
A fun and simple language with NO classes whatsoever!

This language aims to be simple, minimal, and compact. There will not be any classes whatsoever, and importing other files should be painless.

Europa Lang 22 Aug 23, 2022
A neofetch alike program that shows hardware and distro information written in rust.

nyafetch A neofetch alike program that shows hardware and distro information written in rust. installing install $ make install # by default, install

null 16 Dec 15, 2022
Super lightweight and dead-simple CI detection.

This crate tells you if you're in a CI environment or not. It does not tell you which you're in, but it makes a good effort to make sure to accurately

Kat Marchán 9 Sep 27, 2022
1️⃣ el lisp number uno - one lisp to rule them all 🏆

luno el lisp number uno luno is the one lisp to rule them all. Still experimental, do not use it in production yet. goals embeddable small size simple

Eva Pace 3 Apr 25, 2022
Radiate is a parallel genetic programming engine capable of evolving solutions to many problems as well as training learning algorithms.

Radiate Coming from Evolutionary Radiation. Evolutionary radiation is a rapid increase in the number of species with a common ancestor, characterized

kalivas 109 Dec 18, 2022
AI-powered game engine for dynamic, personalized experiences in evolving worlds. Ethical, accessible, inclusive.

ARCADIA: Advanced and Responsive Computational Architecture for Dynamic Interactive Ai: A Whitepaper By Reuven Cohen (rUv) Introduction Imagine a futu

rUv 10 Apr 18, 2023
Evaluate performance gains to expect when EVM were to compile hot contracts into machine code

Convert evm bytecode to native machine code and go vroom - just an experiment, probably broken, reach out to [email protected] to contribute / productionize.

Paradigm 105 Aug 1, 2023
Rust library to generate word cloud images from text and images !

wordcloud-rs A Rust library to generate word-clouds from text and images! Example Code use std::collections::HashMap; use std::fs; use lazy_static::la

Teo Orthlieb 2 Dec 8, 2022
Simple and performant hot-reloading for Rust

reloady Simple, performant hot-reloading for Rust. Requires Rust nightly and only works on Linux for now. installing CLI To install the CLI helper car

Anirudh Balaji 24 Aug 5, 2022
CLI tool to bake your fresh and hot MD files

At least once in your Rust dev lifetime you wanted to make sure all code examples in your markdown files are up-to-date, correct and code is formated, but you couldn't make that done with already existing tools - fear not!

Patryk Budzyński 39 May 8, 2021
A lambda extension to hot reload parameters from SSM Parameter Store, Secrets Manager, DynamoDB, AppConfig

A lambda extension to hot reload parameters from SSM Parameter Store, Secrets Manager, DynamoDB, AppConfig

Jake Scott 7 Jun 12, 2022