logo enkisoftware
Independent software developer making Avoyd
en  fr

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:

  1. How to use Avoyd Voxel Editor to convert your voxel model to mesh for Unreal, Godot or Unity.
  2. How to use Blender to optimise the mesh.
  3. How to use Blender to export to glTF for Unreal 5 and Godot, and to FBX for 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:

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:

  1. Open Avoyd Voxel Editor. (You can use the free version.)
  2. Load the voxel model you want to optimise. You have several options:
  3. Export to Mesh:
    1. Select File > Export > Mesh (.obj)
    2. Enter the .obj file name and press Save.
    3. ☛  With Avoyd 0.26+ you can set Mesh Optimisation to Best and skip the manual optimisation in Blender.
    4. Choose the Material Export option according to the game engine you want to use your model in.
    5. Press Export.

(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:

  1. Open Blender. (Using Blender version 3.6.2.)
  2. Delete the following objects from the Scene Collection:
    • Camera.
    • Cube.
    • Light.
  3. Select File > Import > Wavefront (.obj).
  4. Select the .obj file then click Import OBJ.
    1. Select the object by either clicking on it in the viewport or on the object name.
    2. Set the Viewport Shading to Material Preview (third sphere in the top-right corner). Camper voxel model imported in Blender and selected. The Viewport Shading is set to Material Preview
    3. Set the object Interaction Mode to Edit Mode (drop-down on the top left). Blender object Interaction Mode set to Edit Mode
      1. Choose Select > All (button to the right of the interaction mode control) Blender in Edit Mode: menu select all Blender in Edit Mode: all selected
      2. Choose Mesh > Merge > By Distance (button to the right of the select button). Blender in Edit Mode: menu mesh merge by distance Blender in Edit Mode: mesh merge by distance done
    4. Set the object Interaction Mode to Object Mode.
      1. Select the Modifiers (blue wrench on the right-hand side). Blender in Object mode, Modifier Properties selection
      2. Click Add Modifier
        1. Select Decimate in the Generate column. Blender in Object mode, Added modifier, selected Decimate
        2. Deselect Realtime (small monitor icon next to the word 'Decimate') for better performance.
        3. Open the Planar tab. Blender in Object mode, Added modifier Decimate, Planar tab open
          1. Hold down the Shift key and click all the Delimit options to select them:
            • Normal
            • Material
            • Seam
            • Sharp
            • UVs
          2. Leave All Boundaries unticked.
          3. Leave Angle Limit to 5 degrees. Blender in Object mode, Added modifier Decimate, Planar tab open with Normal, Material, Seam, Sharp and UVs selected
        4. Click the down arrow button (next to decimate) and select Apply. Blender in Object mode, Modifier Decimate with Planar Normal, Material, Seam, Sharp and UVs, 'Apply' option showing
    5. Set the object Interaction Mode to Edit Mode to see the result: the object is cleaned up, it has fewer polygons: Blender in Object mode, Modifier Decimate with Planar Normal, Material, Seam, Sharp and UVs applied. The object has fewer polygon

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 glTF as follows:
    1. Select File > Export > glTF 2.0 (.glb/.gltf).
    2. Name the file filename.glb and click Export glTF 2.0.
  • Unreal 4 and Unity - export to FBX as follows:
    1. Select File > Export > FBX (.fbx).
    2. Name the file filename.fbx and click Export FBX.

Import and Configure in Unreal, Unity or Godot

Finally, follow the relevant guide to import the optimised mesh into your game engine:

[ 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.]