logo
Unity Asset Exporter

unity-to-glb User Guide

Batch-convert Unity content to GLB files with textured PBR materials. Three entry points: shipped Unity games, .unitypackage archives, and plain folders of .fbx files. macOS arm64 binary ships inside the package; no .NET or Unity install required at runtime.

Installation

Terminal
npm install -g @babylonjsmarket/unity-to-glb

Verify:

Terminal
unity-to-glb --version

The tool bundles three pieces: a C# native binary built on AssetRipper for cooked projects + shipped games, the fbx2gltf npm package for raw FBX conversion, and a TypeScript orchestrator that glues them together.


Quick Start

Pick the command that matches your input:

Terminal
# A shipped Unity game
unity-to-glb convert "/Applications/Game.app/Contents/Resources/Data" -o ./out

# A Unity Asset Store package
unity-to-glb unpackage ~/Downloads/Polygon_Pack.unitypackage -o ./out

# A folder of raw .fbx files
unity-to-glb fbx ./Models -o ./out

Each produces ./out/<path>/<asset>.glb mirroring the source hierarchy, plus ./out/_report.json summarizing what was converted and what was skipped.


Three Commands, Three Inputs

Your inputUse
Raw Unity project with a built Library/ cacheconvert
Shipped Unity game (the <Game>_Data/ folder inside a .app, or alongside a .exe)convert
Unity Asset Store .unitypackage fileunpackage
Folder of .fbx files with no Unity metadatafbx

convert — AssetRipper path

Handles cooked Unity content. Requires either (a) a Unity project whose Library/ was populated by opening it once in Unity Editor, or (b) a shipped game's <Game>_Data/ folder.

Terminal
unity-to-glb convert ~/Projects/MyGame -o ./out
unity-to-glb convert "/Applications/Game.app/Contents/Resources/Data" -o ./out

# Filter by name + type
unity-to-glb convert ~/Projects/MyGame -o ./out --types Mesh --filter Character

# Compress textures inside the GLB
unity-to-glb convert ~/Projects/MyGame -o ./out --compress webp --meshopt

# Dry-run: list scannable asset files
unity-to-glb list ~/Projects/MyGame

Unity's standard shader properties (_MainTex, _BumpMap, _MetallicGlossMap, _OcclusionMap, _EmissionMap) are mapped onto glTF PBR channels automatically. _MetallicGlossMap gets channel-swizzled: Unity's R=metal / A=smoothness becomes glTF's G=roughness / B=metal.

unpackage — Unity Asset Store packages

A .unitypackage is a gzipped tar of GUID-named directories. It does not contain Unity's serialized Library/, so the AssetRipper path can't read it directly. Instead this command extracts the archive, reconstructs the Assets/ tree, and converts each raw .fbx inside it via FBX2glTF.

Terminal
unity-to-glb unpackage ~/Downloads/SyntyPack.unitypackage -o ./out

# Filter + parallelism
unity-to-glb unpackage ~/Downloads/SyntyPack.unitypackage -o ./out --filter Ship --concurrency 8

# Keep the extracted project tree for debugging
unity-to-glb unpackage ~/Downloads/SyntyPack.unitypackage -o ./out --keep-staging

Output preserves the package's Assets/ hierarchy (without the leading Assets/ segment).

Caveat: Unity .mat / .prefab / .unity YAML files inside the package are not converted by this flow — they require a Unity-built Library/. Import the package into Unity first and run convert if you need authored materials or scene hierarchies.

fbx — Raw FBX folders

For assets that arrive as plain FBX files with no Unity wrapper at all — Synty "SourceFiles" drops, ArtStation packs, anything else. Recursive by default.

Terminal
unity-to-glb fbx ./Models -o ./out
unity-to-glb fbx ./SingleFile.fbx -o ./out

# Parallelism
unity-to-glb fbx ./Models -o ./out --concurrency 8

Palette Wiring for Synty / Low-Poly Packs

Synty packs (and many low-poly asset packs) share a single palette texture across hundreds of meshes — the mesh UVs point to specific colored regions. The FBX binaries themselves reference .psd files at authoring paths that no longer exist when you unzip the download, so FBX2glTF writes meshes with bare grey materials.

If the pack ships a MaterialList_*.txt index and a sibling Textures/ folder, wire them up with two flags:

Terminal
unity-to-glb fbx "~/Downloads/SourceFiles/FBX" -o ./out \
  --material-list "~/Downloads/SourceFiles/MaterialList_Polygon.txt" \
  --textures "~/Downloads/SourceFiles/Textures"

The parser handles Synty's indentation-based format:

Prefab Name: SM_Bld_Camp_Tent_01
    Mesh Name: SM_Bld_Camp_Tent_01
        Slot: PolygonPack_Mat_01_A (Polygon_Texture_01_A)

For every GLB whose mesh name appears in the list, the tool reads the corresponding PNG from --textures and wires it as baseColorTexture. Verified against a real Synty pack: 1187 of 1193 meshes wired correctly; the 6 stragglers are particle FX meshes that Unity assigns materials to at runtime and simply don't appear in the MaterialList.


Material Mapping Reference

Unity standard / URP Lit shaders (used by convert)

Unity propertyglTF channel
_MainTex, _BaseMap, _BaseColorMapbaseColorTexture
_BumpMap, _NormalMap, _DetailNormalMapnormalTexture
_MetallicGlossMap, _SpecGlossMap, _MetallicSmoothnessMapmetallicRoughnessTexture (R=metal, A=smooth swizzled → G=rough, B=metal)
_OcclusionMap, _AOMapocclusionTexture
_EmissionMap, _EmissiveMapemissiveTexture
_Metallic (float)metallicFactor
_Glossiness, _Smoothness (float)roughnessFactor (inverted: 1 − value)

Properties outside this set land as warnings in _report.json.

FBX-embedded materials (used by unpackage and fbx)

FBX2glTF consumes whatever the FBX binary embeds: typically one diffuse texture per material, plus scalar PBR factors if the FBX was authored with them. Normal / metallic / AO / emission maps rarely survive the Unity → FBX round-trip unless the source pack went out of its way to embed them.


Output Structure

out/
├── Content/
│   ├── Characters/
│   │   ├── SK_Hero.glb
│   │   └── …
│   ├── Environment/
│   │   └── …
│   └── …
└── _report.json

_report.json

JSON
{
  "written": 1193,
  "paletteWired": 1116,
  "skippedCount": 0,
  "skippedFiles": [],
  "warnings": []
}

Scan warnings for specific asset failures. paletteWired only appears on fbx runs that used --material-list.


Examples

Convert a shipped game, compress textures, drop normal/metallic channels

Terminal
unity-to-glb convert "/Applications/SomeGame.app/Contents/Resources/Data" -o ./out \
  --types Mesh,Texture2D \
  --compress webp \
  --meshopt

Convert a Synty pack end-to-end (the common case)

Terminal
unity-to-glb fbx "~/Downloads/POLYGON_Pack/FBX" -o ./pack-glbs \
  --material-list "~/Downloads/POLYGON_Pack/MaterialList_Polygon.txt" \
  --textures "~/Downloads/POLYGON_Pack/Textures" \
  --concurrency 8

Debug a single asset inside a .unitypackage

Terminal
unity-to-glb unpackage ~/Downloads/Pack.unitypackage -o ./out \
  --filter SM_Ship_Fighter_01 \
  --keep-staging

Troubleshooting

unpackage produces 0 GLBs even though the package has models

The archive may not contain .fbx files — some asset store packs ship only .mesh or Unity-serialized binaries. Check the extracted Assets/ tree with --keep-staging and confirm there are raw FBXs present.

"Just yellow" / bare grey materials after an fbx run

The FBX files reference textures that FBX2glTF couldn't find. If the pack includes a MaterialList_*.txt index, pass --material-list and --textures. For generic FBXs, copy the referenced textures into the same folder as the FBX before running.

convert returns 0 assets on a raw Unity project

You need a built Library/ cache. Open the project in Unity Editor once (let it import). Then re-run convert.

macOS Gatekeeper flags the bundled binaries

The native Unity extractor and FBX2glTF binary aren't notarized. Run once:

Terminal
xattr -dr com.apple.quarantine $(npm root -g)/@babylonjsmarket/unity-to-glb

Known CUE4Parse-style AnimSequence warnings (AssetRipper path)

Occasional Object reference not set errors on animations in some Unity versions. Meshes still export correctly. Warnings are non-fatal.


How It Works

         input

   ┌───────┼───────────────┐
   ▼       ▼               ▼
convert  unpackage        fbx
   │       │               │
   ▼       ▼               │
 bin/       tar -xzf        │
 unity-   reconstruct       │
 export   Assets/ tree      │
 (C#      walk *.fbx        │
 + Asset- ────────────────► │
 Ripper)                    │

                   bin/fbx2gltf
                   (per-FBX convert)


                   @gltf-transform
                   - material wiring
                   - palette texture
                   - optional webp / meshopt


                       .glb output

Two-phase wherever possible: a dedicated parser writes intermediate artifacts to a staging directory, then a TypeScript post-processor reads them, wires materials, and streams final GLBs into the output directory as each finishes.


Source + License

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search