22
33Go from zero to your first shader in minutes.
44
5- ## 0) Populate submodules
6- ``` sh
7- git submodule update --init --recursive
8- ```
5+ ## 1) Install
96
10- ## 1) Install + Build
11-
12- ### macOS (Homebrew)
13- Install Vulkan + deps with Homebrew:
7+ ### macOS
8+ Install vsdf and its dependencies with Homebrew:
149``` sh
15- brew install molten-vk vulkan-loader glslang glfw glm spdlog vulkan-tools ffmpeg
10+ brew install jamylak/vsdf/vsdf
1611```
1712
18- Build:
19- ``` sh
20- cmake -B build .
21- cmake --build build
22- ```
13+ ### Linux
2314
24- ### Linux (Ubuntu/Debian)
25- Install dependencies, then build:
26- ``` sh
27- sudo apt-get update
28- sudo apt-get install -y \
29- build-essential cmake ninja-build \
30- libgtest-dev libspdlog-dev \
31- libglfw3 libglfw3-dev libvulkan-dev \
32- glslang-tools glslang-dev libglm-dev \
33- # (Optional) set -DDISABLE_FFMPEG=ON to skip \
34- libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \
35- ```
15+ ** Easiest way to install vsdf:**
16+ Pre-built binaries for Linux are available in the [ GitHub Releases] ( https://github.com/jamylak/vsdf/releases ) page.
17+
18+ To get the ** latest release** :
3619
37- Build:
3820``` sh
39- # FFmpeg is optional; set `-DDISABLE_FFMPEG=ON` (see `CMakeLists.txt`) to build without it.
40- cmake -B build .
41- cmake --build build
21+ LATEST_RELEASE_TAG=$( curl -sL https://api.github.com/repos/jamylak/vsdf/releases/latest | grep ' "tag_name":' | sed -E ' s/.*"([^"]+)".*/\1/' )
22+ DOWNLOAD_URL=" https://github.com/jamylak/vsdf/releases/download/${LATEST_RELEASE_TAG} /vsdf-linux-x86_64.tar.gz"
23+ echo " Downloading from: ${DOWNLOAD_URL} "
24+ curl -LO " ${DOWNLOAD_URL} "
25+ tar -xzf vsdf-linux-x86_64.tar.gz
26+ chmod +x linux/vsdf
27+ sudo mv linux/vsdf /usr/local/bin/vsdf
28+ rm -rf vsdf-linux-x86_64.tar.gz linux # Clean up downloaded files
4229```
4330
4431### Windows (vcpkg)
@@ -57,39 +44,49 @@ cmake --build build
5744 ```
58453 . Build:
5946 ``` powershell
47+ git submodule update --init --recursive
6048 # FFmpeg is optional; set `-DDISABLE_FFMPEG=ON` (see `CMakeLists.txt`) to build without it.
61- cmake -B build -DCMAKE_TOOLCHAIN_FILE="<path-to- vcpkg> /scripts/buildsystems/vcpkg.cmake" .
49+ cmake -B build -DCMAKE_TOOLCHAIN_FILE="C:/ vcpkg/scripts/buildsystems/vcpkg.cmake" .
6250 cmake --build build --config Release
6351 ```
6452
65- ## 2) Launch the sample shader
53+ ## 2) Quick Start - INSTANT shader development!
54+
55+ The fastest way to get started is by using the ` vsdf ` command line tool directly.
56+
57+ 1 . Create a new shader file:
58+
6659``` sh
67- ./build/vsdf --toy shaders/testtoyshader.frag
60+ vsdf --new-toy example.frag # Creates 'example.frag' with a default template
61+ vsdf --new-toy plot.frag --template plot # Creates 'plot.frag' with the 2D plot template
6862```
6963
70- ## 3) Make your own shader (copy and run)
71- Saving your file hot reloads.
64+ 2 . Open the newly created shader file in your favorite editor (e.g., VS Code, Neovim, Sublime Text) and start editing!
7265
73- ### ShaderToy-style
7466``` sh
75- cp shaders/testtoyshader.frag shaders/myshader.frag
76- ./build/vsdf --toy shaders/myshader.frag
67+ code example.frag # VS Code
68+ # or: nvim example.frag # Neovim
69+ # or: subl example.frag # Sublime Text
7770```
7871
79- ### Vulkan-style
72+ 3 . While you're editing, run ` vsdf ` in another terminal to see your changes hot-reload:
8073``` sh
81- cp shaders/vulktemplate.frag shaders/myshader.frag
82- ./build/vsdf shaders/myshader.frag
74+ vsdf --toy example.frag
8375```
8476
85- ## 4) Record video with FFMPEG (offline MP4 encoding)
77+ For a more integrated and faster * experimental* workflow with a shell function that creates the shader, opens the editor, and launches ` vsdf ` in one command, see the [ Shell Integration Guide] ( SHELL_INTEGRATION.md ) .
78+
79+ ## 3) Record video with FFMPEG (offline MP4 encoding)
8680``` sh
87- ./build/vsdf --toy shaders/testtoyshader .frag --frames 100 --ffmpeg-output out.mp4
81+ ./build/vsdf --toy example .frag --frames 100 --ffmpeg-output out.mp4
8882```
8983
9084## Notes
91- - ` --toy ` prepends ` shaders/toytemplate.frag ` to set up push constants in the format
85+ - ` --toy ` sets up push constants and other things in the format
9286ShaderToy uses, e.g., ` iTime ` as well as ` main() ` etc.
87+ - ` --new-toy ` creates an example shader file starting point
88+ - ** Hot reload** : Saving your shader file automatically reloads it in vsdf!
89+ - Available templates: ` default ` (colorful animation), ` plot ` (2D function plotter)
9390
9491## Example: save a ShaderToy and run it locally
95921 . Open the ShaderToy and copy the fragment shader code:
@@ -99,3 +96,7 @@ ShaderToy uses, e.g., `iTime` as well as `main()` etc.
9996``` sh
10097./build/vsdf --toy shaders/raymarching_primitives.frag
10198```
99+
100+ ## Recommendations
101+ I would recommend visiting https://www.shadertoy.com to see their amazing shaders.
102+ Also check out https://iquilezles.org/
0 commit comments