Configs2026年7月13日·1 分钟阅读

nannou — Creative Coding Framework for Rust

An open-source creative coding framework for Rust that makes it easy to build generative art, audiovisual installations, and interactive simulations with GPU-accelerated graphics.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
nannou
直接安装命令
npx -y tokrepo@latest install 5bd64c88-7e73-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

nannou is an open-source creative coding framework for Rust, inspired by Processing and openFrameworks. It provides a batteries-included environment for artists and designers who want the performance and safety of Rust with a friendly API for 2D/3D graphics, audio, and interaction.

What nannou Does

  • Renders real-time 2D and 3D graphics via wgpu (WebGPU backend)
  • Provides a sketch-style API with model, update, and view lifecycle functions
  • Integrates audio I/O through CPAL for generative sound and music visualization
  • Supports GUI widgets, OSC communication, and laser output for installations
  • Ships examples covering particle systems, noise fields, shaders, and more

Architecture Overview

nannou wraps wgpu for cross-platform GPU rendering, winit for windowing, and CPAL for audio. The framework uses an event-driven application loop where the user defines a model struct holding state, an update function for logic, and a view function for drawing. This design keeps creative sketches concise while giving full access to Rust's ecosystem.

Self-Hosting & Configuration

  • Requires a stable Rust toolchain (1.65+); install via rustup
  • GPU drivers must support Vulkan, Metal, or DX12 for wgpu rendering
  • Add features in Cargo.toml: nannou_audio, nannou_osc, nannou_laser
  • Export frames to PNG sequences for video production with app.main_window().capture_frame()
  • Use nannou_egui crate for adding immediate-mode GUI panels to sketches

Key Features

  • wgpu rendering: modern GPU pipeline without OpenGL legacy
  • Audio-visual integration: synchronized sound and graphics in one framework
  • Hot-reload friendly: fast compile times for iterative creative work
  • Cross-platform: runs on macOS, Linux, and Windows
  • Rich example gallery: 100+ sketches demonstrating techniques

Comparison with Similar Tools

  • Processing — Java-based, larger community but slower runtime performance
  • openFrameworks — C++ toolkit with broader addon ecosystem
  • p5.js — browser-based, easier to share but limited by JS performance
  • Cinder — C++ creative framework, similar scope but no Rust safety guarantees
  • Bevy — Rust game engine with ECS; heavier architecture than nannou's sketch model

FAQ

Q: Do I need to know Rust to use nannou? A: Basic Rust knowledge is needed. The API is designed to be approachable, and the examples serve as learning material.

Q: Can I use nannou for live performances? A: Yes. It supports real-time audio input, OSC for MIDI controllers, and low-latency rendering suitable for live visuals.

Q: How does nannou compare to Bevy for creative coding? A: nannou is sketch-oriented with a simpler API. Bevy is a full game engine with an ECS architecture, better suited for complex interactive applications.

Q: Can I export video from nannou? A: nannou can save individual frames as images. Combine them into video with FFmpeg.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产