DOCS // meshfx

meshfx compiled examples Available

Compile the Namaqualand rock scan, articulated washing machine or rubble palette prop into reduced GLB levels of detail with layout.json.

Contents4 sections
  1. Repair the Namaqualand rock scan
  2. Keep the washer door on its hinge
  3. Rubble heap with vertex colours
  4. Questions

meshfx runs on the hosted API: try it in the Playground.

Compile a rock scan, an articulated appliance or a rubble heap into engine-ready GLB levels of detail with these complete specs.

Repair the Namaqualand rock scan

Clean up an 85,716-triangle rock scan with two zero-area faces and build three LODs while keeping the original UVs and textures.

Namaqualand rock scan compiled into three levels of detail
Four textured stones reduced from 85,716 triangles to 24,998, 12,498 and 6,250 triangles.

The Namaqualand Rocks 01 scan from Poly Haven is available under CC0. Pack the mesh and textures into one GLB and set source.file to that file.

This spec keeps source UVs, removes collapsed faces and targets 25,000, 12,500 and 6,250 triangles across the four stones.

namaqualand_rocks.meshfx.toml
# Repair a scanned group of rocks and build lighter meshes for distant views.
# Use the packed Namaqualand Rocks 01 GLB (Poly Haven, CC0). See README.md.
[meta]
name = "namaqualand_rocks"

[source]
kind = "scan"
file = "namaqualand_rocks_01.glb"

[units]
size_m = 1.4

[repair]
enabled = true
resolve_crossings = true
fill_holes = "all"

# Shared triangle budgets for the four stones.
[simplify]
triangles = 25000

[lod]
triangles = [12500, 6250]

[uv]
mode = "keep"

[bake]
source_detail = false
vertex_colour = "keep"

[collision]
mode = "none"

[export]
compression = "none"
lod_layout = "files"
textures_in = "beside"
name_style = "keep"

meshfx outputs three GLB levels at 24,998, 12,498 and 6,250 triangles across the four stones, plus three JPEG texture maps and a layout file.

FileWhat it is
namaqualand_rocks_LOD0.glbnamaqualand_rocks_LOD1.glbnamaqualand_rocks_LOD2.glbThree detail levels of the four-stone set to load into your LOD group.
namaqualand_rocks_base_colour.jpgnamaqualand_rocks_normal.jpgnamaqualand_rocks_metallic_roughness.jpgBase colour, normal and metallic roughness maps kept from the scan
layout.jsonLOD filenames and switch distances for engine loading

Load the three GLB levels into Godot or three.js, keep the three JPEG maps alongside them and switch levels at the distances in godot/layout.json.

EngineImport
GodotImport each GLB as a scene, use the layout level order and visibility ranges to switch meshes, or instantiate the .tscn with articulated.gd and call set_joint("door_hinge", angle_radians) on the root.
UnityImport the GLB with materials and vertex colors intact, derive LOD Group screen-relative thresholds from the layout distances for your game camera, or rotate and translate named pivots along their exported local axes.
Unreal EngineImport the GLB through Interchange, build the Static Mesh LOD chain from the level files, or keep moving meshes under their pivots in a Blueprint using centimetres and degrees.
three.jsLoad each GLB with GLTFLoader into a THREE.LOD using layout switch distances, or find pivots with getObjectByName to rotate or translate them relative to their rest transforms.

Download input GLB · Hosted output files

Keep the washer door on its hinge

Compile an articulated washing machine into three GLB levels of detail while keeping all seven rigid parts and four moving joints intact.

Articulated washing machine with open door and extended drawer
Articulated washing machine compiled into three levels of detail with seven rigid parts and four joints.

The articulated appliance example preserves the cabinet, door hinge, detergent drawer and rotating drum across LODs.

The spec preserves the input pivot hierarchy so meshfx processes each rigid part separately without merging the frame, door, drawer or drum.

washing_machine.meshfx.toml
# Sandflow washing machine from sand3d 1.6.3, Apache-2.0.
# From the repository root, stage the recipe and licensed fixture together:
# mkdir -p /tmp/spc-washer
# cp plugin/skills/meshfx/examples/washing_machine.meshfx.toml /tmp/spc-washer/
# cp tests/data/sand3d/{washing_machine.glb,LICENSE,NOTICE} /tmp/spc-washer/
# spc bake /tmp/spc-washer/washing_machine.meshfx.toml --out /tmp/spc-washer/bake
[source]
file = "washing_machine.glb"
hierarchy = "tree"

[units]
pivot = "keep"

[simplify]
triangles = 3000

[lod]
triangles = [1700, 950]

[collision]
mode = "none"

[export]
lod_layout = "files"

# The source uses solid part colours and has no UV set for a detail map.
[bake]
source_detail = false

[uv]
mode = "keep"

meshfx outputs three articulated GLB levels at 2,940, 1,700 and 950 triangles with 7 reported draw calls, plus a layout file and optional Godot scene and script.

FileWhat it is
washing_machine_LOD0.glbwashing_machine_LOD1.glbwashing_machine_LOD2.glbThree articulated detail levels of the appliance to load with preserved pivots.
layout.jsonLOD switch distances plus pivot names and joint limits
washing_machine.tscnarticulated.gdOptional Godot scene and script exposing get_joints() and set_joint()

Instance godot/washing_machine.tscn in Godot and call set_joint() on godot/articulated.gd, or load the GLB levels in three.js and drive the named pivot nodes.

EngineImport
GodotImport each GLB as a scene, use the layout level order and visibility ranges to switch meshes, or instantiate the .tscn with articulated.gd and call set_joint("door_hinge", angle_radians) on the root.
UnityImport the GLB with materials and vertex colors intact, derive LOD Group screen-relative thresholds from the layout distances for your game camera, or rotate and translate named pivots along their exported local axes.
Unreal EngineImport the GLB through Interchange, build the Static Mesh LOD chain from the level files, or keep moving meshes under their pivots in a Blueprint using centimetres and degrees.
three.jsLoad each GLB with GLTFLoader into a THREE.LOD using layout switch distances, or find pivots with getObjectByName to rotate or translate them relative to their rest transforms.

Download input GLB · Hosted output files

Rubble heap with vertex colours

Reduce a 101,760-triangle, 4 m rubble heap into two GLB levels of detail while keeping its vertex colours.

Compiled 4 m rubble heap with vertex colours
Rubble heap reduced from 101,760 triangles to 20,000 and 1,500 triangles with vertex colours preserved.

The spec targets 20,000 and 1,500 triangles and preserves vertex colours without external texture maps.

palette_prop.meshfx.toml
# Keep the rubble heap’s vertex colours as its triangle count drops with distance.
# Generate palette_prop.glb using the command in README.md.
[meta]
name = "palette_prop"

[source]
file = "palette_prop.glb"

[units]
size_m = 4.0                # the heap is 4 m long

[simplify]
triangles = 20000           # the game's prop LOD0

[lod]
triangles = [1500]          # LOD0 plus one low mesh for its 40 m camera

[collision]
mode = "none"

[uv]
mode = "keep"

[bake]
source_detail = false
vertex_colour = "keep"

[export]
targets = ["godot"]
forward = "-z"
name_style = "lower_snake"
compression = "none"
lod_layout = "files"

meshfx outputs two GLB levels at 20,000 and 1,500 triangles with 1 reported draw call and a layout file.

FileWhat it is
palette_prop_LOD0.glbpalette_prop_LOD1.glbTwo detail levels of the rubble heap with vertex colours to load into your LOD group.
layout.jsonLOD filenames and switch distances for engine loading

Load both GLBs into Godot or three.js, assign a material that reads vertex colour and switch levels using godot/layout.json.

EngineImport
GodotImport each GLB as a scene, use the layout level order and visibility ranges to switch meshes, or instantiate the .tscn with articulated.gd and call set_joint("door_hinge", angle_radians) on the root.
UnityImport the GLB with materials and vertex colors intact, derive LOD Group screen-relative thresholds from the layout distances for your game camera, or rotate and translate named pivots along their exported local axes.
Unreal EngineImport the GLB through Interchange, build the Static Mesh LOD chain from the level files, or keep moving meshes under their pivots in a Blueprint using centimetres and degrees.
three.jsLoad each GLB with GLTFLoader into a THREE.LOD using layout switch distances, or find pivots with getObjectByName to rotate or translate them relative to their rest transforms.

Download input GLB · Hosted output files

Questions

How many triangles remain in the Namaqualand rock scan after meshfx reduction?

meshfx reduces the four textured stones from 85,716 input triangles to three levels with 24,998, 12,498 and 6,250 triangles.

What files does meshfx output for the Namaqualand rock scan example?

meshfx outputs three GLB level files, three JPEG maps for base colour, normal and metallic roughness, plus layout.json.

How does the washing machine example preserve its moving parts?

The spec preserves the input pivot hierarchy so meshfx processes all seven rigid parts and four joints separately across three detail levels.