3 个不稳定版本
0.2.1 | 2019年3月22日 |
---|---|
0.2.0 | 2019年3月10日 |
0.1.0 | 2018年6月18日 |
#475 in 图形API
165KB
3.5K SLoC
grimoire —

什么是?
grimoire 是一个跨平台(Windows、MacOS、“Linux”)的实时编码工具,用于创建类似 shadertoy 和 vertexshaderart 风格的 GLSL 着色器演示。用户编写一个 TOML 配置文件,该文件定义了资源(图像、视频、音频、网络摄像头、3D 纹理、kinect 数据)和渲染通道(顶点着色器、片段着色器、原语类型和数量、混合状态、深度状态、统一采样器)。您的着色器、资源和配置文件会实时更新。请参阅下面的示例以开始使用或阅读 SPEC.md 了解配置模式和工作流程的详细描述。
grimoire 是我的个人原型设计工具,目前处于开发初期。您可能会遇到错误,功能可能会随时更改。不要期望得到支持。抛开这些不说,我认为 grimoire 是一个易于使用、健壮且功能强大的原型设计工具。欢迎反馈!
示例:与 shadertoy 兼容性
以下着色器展示了与各种 shadertoy 功能的兼容性。所有内容均受原版权所有者版权保护,并按指定条款或默认 shadertoy 许可证许可。如果您不希望您的工作包含在此列表中,您可以联系我,我将立即将其删除。
- new,源码:
cargo run -- ./examples/shadertoy-new
- debug,源码:
cargo run -- ./examples/shadertoy-debug
- mouse,源码:
cargo run -- ./examples/shadertoy-mouse
- keyboard,源码:
cargo run -- ./examples/shadertoy-keyboard-debug
- time,源码:
cargo run -- ./examples/shadertoy-time
- fps,源码:
cargo run -- ./examples/shadertoy-fps
- microphone,源码:
cargo run -- ./examples/shadertoy-microphone
- sound,源码:
cargo run -- ./examples/shadertoy-sound
- multipass w/ feedback,源码:
cargo run -- ./examples/shadertoy-deformation-feedback
- video:
cargo run -- ./examples/video
- webcam:
cargo run -- ./examples/webcam
安装
您需要使用 rust 从源代码构建和安装 grimoire,并安装所需的系统依赖项
grimoire目前针对rust stable 1.33,2018版构建。
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
如果在MacOS 10.14(Mojave)上运行,请确保在运行使用摄像头或麦克风资源的演示之前,手动将Info.plist复制到target/debug
或target/release
。此文件的存在允许MacOS提示权限以访问摄像头和麦克风。
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
- 下载并运行msys2
- 使用
x86_64-pc-windows-gnu
工具链:rustup default stable-x86_64-pc-windows-gnu
- 使用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
- 在运行之前,手动将SDL2.dll复制到顶级grimoire源目录(包含Cargo.toml的目录)
请注意,您需要确保您的PATH
包含mingw64/bin目录,并且您的PKG_CONFIG_PATH
列出包含所有.pc文件的目录。由于我使用scoop安装了msys2,我的.bash_profile
包含以下行
PATH="$PATH:/c/Users/jshrake/scoop/apps/msys2/current/mingw64/bin"
PKG_CONFIG_PATH="/c/Users/jshrake/scoop/apps/msys2/current/mingw64/lib/pkgconfig"
面包屑
资源
片段着色器
顶点着色器
灵感
- shadertoy
- vertexshaderart
- bonzomatic
- interactiveshaderformat
- 着色器之书
- https://shadertoyunofficial.wordpress.com/
许可证
根据您的选择,许可方式如下
- Apache License,版本2.0,(LICENSE-APACHE或https://apache.ac.cn/licenses/LICENSE-2.0)
- MIT许可证(LICENSE-MIT或http://opensource.org/licenses/MIT)
。
贡献
除非您明确表示,否则任何有意提交以包含在作品中的贡献,如Apache-2.0许可证中定义,应按照上述方式双许可,不附加任何额外条款或条件。
依赖项
~50MB
~738K SLoC