Optimising Voxel Meshes for Games Using Blender
Doug Binks - Juliette Foucaut - - edited # Game Technology
Reducing the number of polygons in 3D objects helps improve a game's performance. This tutorial explains step by step how to clean up the geometry of voxel models in Blender to prepare them for export to game engines like Unreal, Godot or Unity.
Note you may have encountered 'polygon reduction' techniques under other names such as 'vertex reduction', '3D model optimisation' or '3D model clean up'.
This post covers the following workflow:
- How to use Avoyd Voxel Editor to convert your voxel model to mesh for Unreal, Godot or Unity.
- How to use Blender to optimise the mesh.
- How to use Blender to export to
glTFfor Unreal 5 and Godot, and toFBXfor Unreal 4 and Unity, and Links to guides for importing and configuring the model in each engine.
☛ Update to Avoyd version 0.26 or above:
- You can now export to
.objwithBestoptimisation to skip the manual optimisation in Blender. - If you own Avoyd we recommend you export your voxel model to glTF Binary Mesh
.glbinstead of .obj. This both optimises your mesh better and simplifies your workflow. You can then directly import your.glbmesh into your game engine.
Convert the Voxel Model to Mesh Using Avoyd
Use Avoyd (1*) to export your voxel model to mesh .obj - together with its materials and their properties, such as metallic, transparent and emissive - for games as follows:
- Open Avoyd Voxel Editor. (You can use the free version.)
- Load the voxel model you want to optimise. You have several options:
- Open a
.avwrAvoyd world file usingFile > Open. (You can downloadCamper.avwr.) - Import a MagicaVoxel
.voxfile, a heightmap or a Minecraft file.
- Open a
- Export to Mesh:
- Select
File > Export > Mesh (.obj) - Enter the
.objfile name and pressSave. - ☛ With Avoyd 0.26+ you can set
Mesh OptimisationtoBestand skip the manual optimisation in Blender. - Choose the
Material Exportoption according to the game engine you want to use your model in. - Press
Export.
- Select
(1* Note you can also use MagicaVoxel to export .vox to .obj. However it exports all the materials as diffuse, thus losing the metallic, transparency and emissive properties.)
Optimise the Mesh Using Blender
☛ You can skip this section if you used Avoyd 0.26+ with Best optimisation on export.
Open the .obj file in Blender and clean up the geometry as follows:
- Open Blender. (Using Blender version 3.6.2.)
- Delete the following objects from the
Scene Collection:Camera.Cube.Light.
- Select
File > Import > Wavefront (.obj). - Select the
.objfile then clickImport OBJ.- Select the object by either clicking on it in the viewport or on the object name.
- Set the
Viewport ShadingtoMaterial Preview(third sphere in the top-right corner).
- Set the object
Interaction ModetoEdit Mode(drop-down on the top left).
- Set the object
Interaction ModetoObject Mode. - Set the object
Interaction ModetoEdit Modeto see the result: the object is cleaned up, it has fewer polygons:
Export the Model to Game Engines
Export to FBX or glTF Using Blender
In Blender, export to glTF or FBX depending on the destination game engine.
- Unreal 5 and Godot - export to
glTFas follows:- Select
File > Export > glTF 2.0 (.glb/.gltf). - Name the file
filename.glband clickExport glTF 2.0.
- Select
- Unreal 4 and Unity - export to
FBXas follows:- Select
File > Export > FBX (.fbx). - Name the file
filename.fbxand clickExport FBX.
- Select
Import and Configure in Unreal, Unity or Godot
Finally, follow the relevant guide to import the optimised mesh into your game engine:
- Import .obj into Unreal Engine via glTF for UE5 and via FBX for UE4.
- Import .obj into Godot Engine via glTF.
- Import .obj into Unity 3D via FBX.
[ Edit 03 Oct 2023 - Added Godot and Unreal 5 export to glTF.]
[ Edit 16 Jan 2025 - Added step 4.4.2.2 to deselect Realtime.]
[ Edit 14 Mar 2025 - Added Avoyd 0.26 'Best' obj optimisation that replaces the manual optimisation in Blender. - Added link to export to glTF, a better workflow for games.]
[ Edit 12 Apr 2025 - Clarified Avoyd 0.26+ workflows.]
[ Edit 14 May 2025 - Added information about import guides for game engines.]