Learn VELATO with Real Code Examples
Updated Nov 26, 2025
Architecture
Input: Lottie JSON file (exported via Bodymovin from After Effects)
Parser: Rust code to deserialize JSON into a `Composition` data structure
Renderer: `velato::Renderer` translates the composition into a Vello `Scene`
Graphics backend: Vello draws the scene using GPU (or fallback) per frame
Optional integration: application’s render loop (desktop or wasm/web) calls Velato to draw animated frames
Rendering Model
Parser reads Lottie JSON -> Rust data structure
Renderer converts data to Vello scene graph objects
GPU backend draws the scene each frame
Frame-based rendering allows precise control (frame 0.0 -> last frame)
Scene graph can be combined with other custom drawings
Architectural Patterns
Separation of parsing (data) and rendering (graphics)
Scene graph abstraction (via Vello) for device‑agnostic drawing
Asset-based workflow (JSON animations, images if any)
Render loop abstraction - desktop or wasm/web
Optional layering: combine Lottie animations with custom Rust UI or graphics
Real World Architectures
Rust-based desktop application with animated onboarding screens
Game UI built in Rust where menu and HUD animations come from Lottie via Velato
Cross-platform (desktop + web) app using Velato for animated graphics and Vello for rendering
Interactive data visualization with animated vector charts/infographics
Prototyping animation-based UI components in Rust to reuse across projects
Design Principles
Safe, idiomatic Rust API
Reuse Lottie specification to enable designer‑to‑dev workflow
GPU-accelerated rendering for performance
Minimal dependencies and dual‑license (MIT/Apache)
Cross‑platform support including native and wasm/web
Scalability Guide
Reuse Composition and Renderer objects lifecycle rather than repeatedly re-creating them
Avoid very heavy or high‑frame‑rate animations if targeting lower‑end hardware or WebGPU-limited browsers
Batch animations or defer rendering when off-screen
Optimize Lottie files: reduce layers, avoid complex effects, simplify shapes
Profile and monitor GPU and memory usage under load
Migration Guide
Take existing Lottie animations -> parse in Velato -> render in Rust app
If animations include unsupported features (text, images, effects) -> consider simplifying in After Effects or fallback to alternative assets
For web build: set up wasm/WebGPU pipeline and test across target browsers
Modularize renderer and animation logic to isolate dependency on Velato
Test across platforms (desktop, web, mobile) if applicable