Quickstart
Three minutes from cargo add to a textured quad on screen.
1. Add the dependency
[dependencies]
wisp = "0.1"
2. The smallest scene that draws
#![allow(unused)] fn main() { use wisp::prelude::*; fn build_scene() -> Stage { let mut stage = Stage::new(StageOptions { size: (1920, 1080), clear_color: [0.0, 0.0, 0.0, 1.0], }); let id = stage.spawn(Sprite { position: vec2(960.0, 540.0), size: vec2(800.0, 450.0), anchor: vec2(0.5, 0.5), texture: TextureRef::Solid([0.4, 0.6, 1.0, 1.0]), ..Default::default() }); stage.tick(0.0); stage } }
3. Drive the frame loop
Pick a host:
- Native window via
winit— wisp'sApplication::from_wgpuaccepts awgpu::Device+wgpu::Surfaceand renders straight to it. - Headless — render into a
RenderTextureand callread_pixelsfor PNG dumps or push the BGRA bytes into GStreamerappsrc → vtenc_h264_hw → mp4mux → filesinkfor MP4 output.
See Headless export and Recorder mock for both flows running end-to-end.
4. Add a filter
#![allow(unused)] fn main() { let id = stage.spawn(Container::default()); stage.attach_filter(id, BlurFilter::new(8.0)); stage.attach_filter(id, DropShadowFilter::new() .with_offset(vec2(8.0, 8.0)) .with_blur(12.0)); }
Filters compose left-to-right. The filter chain example animates three filters layered on one container.
5. Read the deep dive
- Renderer overview —
Container/Sprite/Graphics/Text, the frame pump,RenderTexture. - Sprite batcher — how the renderer collapses N sprites into one draw call.
- Filter chain — composing multiple post-process passes.
- Text architecture — bitmap vs flexible text, glyph atlas, layout pipeline.
- Mask system — dynamic mask textures, vector → mask bridging.
wisp is the renderer behind Screen Studio, a native Rust screen recorder. If you want to see how an editor / capture pipeline / encoder integrates with wisp, the screen project book at /Screen/ has the full integration story.