Rusty Shadertoy Browser

Build Status MIT/Apache

Small Shadertoy browser & viewer for Mac built in Rust.

This application uses the Shadertoy REST API to search for Shadertoys and then downloads them locally and converts them using shaderc-rs and spirv-cross to be natively rendered on Mac using metal-rs.

The API queries are done through the shadertoy crate, which is also part of this repository in src/shadertoy

Render Output

Building

First make sure you have Rust installed installed. Then building & running is easy:

```sh $ git clone https://github.com/repi/shadertoy-browser $ cd shadertoy-browser $ cargo build --release

this will download and view all shadertoys with "car" in the name

$ cargo run --release -- -s car ```

Usage

Keys:

If the screen is red that indicates the shader wasn't able to be built.

Optional command-line settings:

```text USAGE: shadertoy-browser [FLAGS] [OPTIONS]

FLAGS: -b, --buildall Build all shaders upfront. This is useful to stress test compilation, esp. together with --headless --help Prints help information -h, --headless Don't render, only download shadertoys -V, --version Prints version information

OPTIONS: -k, --apikey Set shadertoy API key to use. Create your key on https://www.shadertoy.com/myapps [default: BtHtWD] -f, --filter ... Inclusion filters [values: VR, SoundOutput, SoundInput, Webcam, MultiPass, MusicStream] -o, --order Sort order [default: Popular] [values: Name, Love, Popular, Newest, Hot] -s, --search Search string to filter which shadertoys to get -t, --threads How many threads to use for downloading & processing shaders. 0 = disables threading, -1 = use all logical processors [default: -1] ```

To use the Rust shadertoy API directly in another app or library, check out the shadertoy crate, docs and README.

License

Licensed under either of the following, at your option:

Contribution

Contributions are welcome! Please note that your contributions are assumed to be dual-licensed under Apache-2.0/MIT.