NXSand¶
NXSand is a falling-sand sandbox for Nintendo Switch homebrew. Pour sand, spill water, light fires, and watch a GPU Margolus cellular automaton run at handheld-friendly resolution. Paint with Joy-Con or touch, pick materials from a ring, save three worlds, and tune performance when you need smoother play.
The primary artifact is NXSand.nro. Desktop builds (SDL2 + OpenGL ES 3.0 + ANGLE on Windows) exist for faster iteration; Switch hardware remains the performance target.
Showcase¶
Gameplay on Nintendo Switch — materials, reactions, and save slots:
Quick links¶
| I want to… | Start here |
|---|---|
| Install on a Switch | Install on Switch |
| Learn controls | Controls |
| Understand materials | Physics & materials |
| Build from source | Native build |
| Read the runtime design | Architecture |
| Browse diagrams | Diagram catalog |
How it works (short)¶
Each sim step runs four Margolus phases on ping-pong GL_R8UI textures. Rules live in shaders/sim_common.glsl. Presentation uses a custom OpenGL UI (quads + font atlas) — no ImGui and no SDL_Renderer for gameplay.
Play frame pipeline¶
Margolus substep¶
Downloads¶
- Releases — GitHub Releases (Switch, Linux, and Windows portable zips).
- CI artifacts — native-nro workflow uploads
NXSand-switch.zipwithswitch/NXSand.nro(and optionalNXSand.nspwhenSWITCH_PROD_KEYSis set).
Materials (overview)¶
Twenty brush materials (IDs 1–17, 20–22) plus spawn-only Ember (18) and Flower (19). ID 0 is empty. Brick (22) is a cohesive heavy solid with no chain explosions. Full tables and reaction notes: Physics & materials. Detailed reaction graph: diagrams/material-reactions.mmd.
License¶
MIT — see LICENSE.