This is a template repository that can be used as a starting point when making (somewhat) small demoscene productions in Rust.
- Minify shader sources as a build step using Shader_Minifier
- Create a fullscreen 1920x1080 window
- Load a fragment shader (the default example from Shadertoy)
- Load and play a WaveSabre song using wavesabre-rs
- Update the shader uniform (iTime) each frame
- Render until the song ends
A release build (cargo build --release
) of this project as is will result in a binary size of 28 672 bytes.
Packing it with UPX can then reduce it down to 16 384 bytes.
If you have a demo without music, or if you bring your own software synth, the size without music may be of interest.
5 120 bytes as is, but with some more linker tweaks it can be brought down further to 4 208 bytes, which UPX cannot improve.
- in4k/isystem1k4k for showing the bare minimum Win32 calls required to set everything up.
- mcountryman/min-sized-rust-windows for the linker flags I use in
build.rs
to reduce the size of the binary.