Procedural · LLM-friendly · Engine-ready

From a few lines of DSL to a .glb you can drop into your engine.

MoGen compiles a compact declarative language into glTF 2.0. It's the deterministic backend of an LLM-driven 3D generation pipeline: the model writes intent, MoGen writes triangles. Single binary CLI, a desktop studio, and an LLM-powered generate / modify / animate loop. Works with multiple LLM backends — Gemini Pro is the strongest model we've tested and the recommended default.

MoGen splash artwork

Downloads

Loading the latest release from GitHub…

Verify with the SHA256SUMS file attached to each release. Builds are produced by release.yml on every v* tag — Linux x86_64, macOS Intel + Apple Silicon, Windows x86_64.

Tiny DSL, real geometry

30+ primitives, CSG union/difference/intersect, modules with parameters, replicators (array, mirror, stack, grid), and a placement vocabulary an LLM can actually use.

Self-contained GLBs

PBR materials, transmission, emissive HDR, double_sided, embedded PNG/JPEG textures. Drop the output into your engine, Blender, or three.js — no asset chasing.

LLM-aware pipeline

mogen generate "a wooden stool" writes a .mog, validates it, repairs JSON diagnostics in a loop, and emits a GLB. Seeds are embedded for reproducibility.

Playground

The whole MoGen pipeline — parser, validator, lowering, glTF exporter — is compiled to WebAssembly and runs in your browser. Type on the left, see the GLB on the right, no installs and nothing leaves your machine. Examples from the repo are pre-loaded; pick one from the dropdown to start.

Each of these started as a one-line prompt fed to mogen generate — the LLM wrote the .mog, MoGen lowered it to glTF, and the output below is the raw GLB rendered in MoGen Studio. Hover any tile to play.

Hello, chair.

This is a real, complete .mog file. Save it as chair.mog and run mogen build chair.mog --out chair.glb:

// A simple four-legged chair.
material "wood" (color=[0.55, 0.35, 0.18], roughness=0.8)

scene {
  rounded_box "seat" (size=[0.45, 0.04, 0.45], radius=0.01, mat="wood") {
    connector "c_fl" (at=[-0.18, -0.02, -0.18], dir=[0, -1, 0])
    connector "c_fr" (at=[ 0.18, -0.02, -0.18], dir=[0, -1, 0])
    connector "c_bl" (at=[-0.18, -0.02,  0.18], dir=[0, -1, 0])
    connector "c_br" (at=[ 0.18, -0.02,  0.18], dir=[0, -1, 0])
    connector "c_back" (at=[0, 0.02, 0.205], dir=[0, 1, 0])
  }

  cylinder "leg_fl" (radius=0.02, height=0.45, mat="wood")
  cylinder "leg_fr" (radius=0.02, height=0.45, mat="wood")
  cylinder "leg_bl" (radius=0.02, height=0.45, mat="wood")
  cylinder "leg_br" (radius=0.02, height=0.45, mat="wood")

  rounded_box "backrest" (size=[0.45, 0.45, 0.04], radius=0.01, mat="wood")

  attach (parent="seat", child="leg_fl", socket="c_fl", plug="top")
  attach (parent="seat", child="leg_fr", socket="c_fr", plug="top")
  attach (parent="seat", child="leg_bl", socket="c_bl", plug="top")
  attach (parent="seat", child="leg_br", socket="c_br", plug="top")
  attach (parent="seat", child="backrest", socket="c_back", plug="bottom")
}

The whole language is one shape — kind "name" (attrs) { children } — repeated. Full reference →

MoGen Studio

The desktop editor pairs the DSL source with a live 3D viewer — type, see, repeat. Click a screenshot to open full size.

Install

Linux and macOS — one-liner. Pulls the latest release, verifies the SHA-256, drops mogen and mogen-studio into $HOME/.local/bin:

curl -fsSL https://raw.githubusercontent.com/krazyjakee/MoGen/master/scripts/install.sh | bash

Pass options after -s --: --version, --bin-dir, --cli-only, --studio-only, --force.

Windows — grab the .msi (Studio) or .zip (CLI) from the downloads above.

Build from source

Requires a recent stable Rust toolchain. On Linux you also need the GTK / Wayland / X11 dev headers that eframe links against.

git clone https://github.com/krazyjakee/MoGen.git
cd MoGen
./scripts/build-release.sh                          # cargo build --release --workspace
./scripts/run-mogen.sh build examples/chair.mog --out chair.glb
./scripts/run-studio.sh                             # launch MoGen Studio

On Debian/Ubuntu, the Studio's runtime deps are libgtk-3-dev libxkbcommon-dev libwayland-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb1-dev libssl-dev pkg-config.

What's inside

CrateRole
mogen-corePure data types — SceneGraph, Transform, Mesh, Material, Connector, animation/skinning structs, diagnostics.
mogen-dslPest grammar, AST, and the lowering pipeline (module.rs + lower.rs + attach.rs + anim_lower.rs + skin_lower.rs).
mogen-validateTwo-phase validator: AST-level (typing/refs) and graph-level (topology/weights). Human and JSON renderers.
mogen-geomPrimitive meshers, CSG via csgrs, vertex welding, degenerate-tri cull, normal recompute.
mogen-animProcedural animation templates — spin, open_close, wave, flap, idle.
mogen-exportHand-rolled GLB writer: PBR materials, embedded textures, animation channels, JOINTS_0/WEIGHTS_0 skins, sibling-mesh merge pass.
mogen-llmLLM client (Gemini Pro recommended), system-prompt assembly, repair loop, texture pipeline.
mogenThe CLI binary — clap subcommands wiring everything together.
mogen-studioThe desktop GUI — eframe/egui editor, live 3D viewer, gizmos, theme presets, settings persistence.