Skip to content

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:

Watch gameplay video (MP4)

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)

NXSand overview — Switch homebrew, GPU sim, materials

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

Play frame pipeline

Margolus substep

Margolus substep — four phases per tick

Downloads

  • Releases — GitHub Releases (Switch, Linux, and Windows portable zips).
  • CI artifacts — native-nro workflow uploads NXSand-switch.zip with switch/NXSand.nro (and optional NXSand.nsp when SWITCH_PROD_KEYS is set).

CI and release flow

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.

Material reactions (overview)

License

MIT — see LICENSE.