Optimize GLB Model
sirv_optimize_glbShrink binary .glb 3D models by cleaning meshes and applying Draco compression, with optional simplification and texture compression for faster loading.
Instructions
Make a binary .glb 3D model of up to 100 MB smaller: mesh clean-up, Draco compression, and optional simplification and texture compression.
Use it after sirv_generate_3d_model, or for any GLB file that must load faster. Do not use it to make a model from a photo: use sirv_generate_3d_model.
Inputs: only glb_url is required. The clean-up and compression switches default to on. simplify_ratio 1 (the default) keeps the whole mesh; a lower value removes detail. texture_format and texture_size default to null, which keeps the textures as they are.
The source file does not change. Returns optimized_url, the size before and after in bytes, the reduction in per cent, and the vertex and triangle counts.
Credits: spends workspace credits. The cost depends on the model and options.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"glb_url": "<glb_url>"
},
"name": "sirv_optimize_glb"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| join | No | Join separate meshes where possible. Default: true | |
| weld | No | Merge vertices that sit at the same point. Default: true | |
| dedup | No | Remove duplicate meshes, textures and materials. Default: true | |
| draco | No | Compress the mesh with Draco. Default: true | |
| prune | No | Remove unused data. Default: true | |
| flatten | No | Flatten the scene hierarchy. Default: true | |
| glb_url | Yes | Public HTTPS URL of a binary .glb file, up to 100 MB | |
| instance | No | Store repeated meshes once. Default: true | |
| quantize | No | Store vertex data with fewer bits before compression. Default: true | |
| texture_size | No | Largest texture side in pixels. Default: null, which keeps their size | |
| simplify_error | No | Largest shape error simplification may cause, 0 to 1. Default: 0.001 | |
| simplify_ratio | No | Share of the mesh to keep, 0 to 1. 1 keeps all of it. Default: 1 | |
| texture_format | No | Convert textures to this format. Default: null, which keeps their format |