POLYMASON

How to import an OBJ into Unreal Engine

Part of The OBJ file format, explained for game engines

Unreal works in centimetres and everyone else in metres, so the first thing an OBJ does in Unreal is arrive a hundred times too small. This is the import dialog, setting by setting, and what to do about the rest. The OBJ's own gaps, units and axes among them, are in the OBJ guide; Unity and Godot have their own articles, and OBJ, FBX, GLB or STL is for when the format is still a choice.

The import

  1. In the Content Browser, press Import, or drag the .obj into it. Keep the .mtl and any texture in the same folder as the .obj when you do.
  2. The FBX Import Options dialog appears; Unreal uses the same dialog for OBJ. Set the options below and press Import, or Import All if there are several files.
  3. Drag the resulting Static Mesh into the level.

In Unreal 5.x with the Interchange framework enabled, the dialog looks different but the same settings are in it under the same names.

The scale

Unreal's unit is the centimetre. An OBJ has no unit, and a model made in metres, as almost every game model is, comes in a hundredth the size. In the dialog, under Transform, set Import Uniform Scale to 100. A model made in centimetres needs 1, in millimetres 0.1.

If it has already been imported small, open the Static Mesh, and in its details under Import Settings set the scale and press Reimport Base Mesh; or, quicker for one instance, scale the actor in the level, though a scaled actor scales its collision and confuses physics and lighting, so the reimport is better.

The up axis

Unreal is Z-up; most OBJ files are made Y-up. Under Miscellaneous, Convert Scene is on by default and rotates a Y-up model to stand up in Unreal. Leave it on for a file from Blender, Unity, or any Y-up tool. Force Front XAxis turns the model to face Unreal's convention of +X forward; on if the model's front should face that way, which for a tree does not matter.

Normals

Under Mesh, Normal Import Method has three values. Import Normals keeps the normals in the file; this is what you want for a file with flat normals. Compute Normals throws them away and calculates smooth ones, which on a low poly model gives the balloon look. Import Normals and Tangents also takes tangents from the file, which an OBJ does not have. Set it to Import Normals for a file that has them.

If the file has no normals, Compute is what happens regardless, and the model comes in smooth; the fix is a file with normals in it. The flat shading guide explains why; the same reasoning applies here.

Materials

Under Material, Material Import Method decides what Unreal makes from the .mtl: Create New Materials makes a material per newmtl, Create New Instanced Materials makes instances of a base material, and Do Not Create Material gives every slot the default grey. Import Textures brings in the map_Kd textures it can find beside the file. For a palette-textured model, Create New Materials with Import Textures on gives one material with the palette as its base colour, which is right; set its Roughness to 1 and Specular low so the flat colour does not look wet.

The mesh gets a material slot per usemtl, visible in the Static Mesh editor under Material Slots, where you can swap any of them.

Collision

Generate Missing Collision under Mesh adds simple collision to the mesh, a box or capsule, which for a prop is fine and for a tree traps the player under the canopy. Turn it off for trees and add a capsule for the trunk in the Static Mesh editor: Collision menu, Add Capsule Simplified Collision, then size it to the trunk.

Levels of detail

Levels of detail are their own subject, in LODs and billboards for low poly models; in Unreal they live in the Static Mesh editor, where LOD Settings has Number of LODs; set it to three and Unreal reduces the mesh itself for LOD1 and LOD2, with a percentage of triangles per level and a screen size at which each is used. Automatic reduction is fine for LOD2 and rough for LOD1 on a low poly model, because it removes the facets. To use levels made by hand, set LOD Import to import each file as a level: LOD Settings, LOD Import, Import LOD Level 1, and choose the file. PolyMason's export gives LOD1 and LOD2 as separate files for this.

Nanite

Nanite is Unreal's virtual geometry for meshes of millions of triangles. A low poly tree of three hundred is not what it is for, and enabling it, Build Nanite in the dialog or in the Static Mesh editor, costs more than it saves at that size. Leave it off for low poly work; Unreal's ordinary LODs and instancing do the job.

Many trees

For a forest, use Instanced Static Mesh or Hierarchical Instanced Static Mesh components, or the Foliage tool, which paints instances and handles LOD and culling per instance. One material per tree keeps every instance in one draw call per level of detail, which is where the palette texture earns its keep.

What PolyMason's files need

Import Uniform Scale 100, Convert Scene on, Normal Import Method on Import Normals, and the .mtl and palette PNG beside the .obj so the material and its texture come in. Everything else on the dialog can stay at its default.

More in this guide

Or build a tree and see what comes out.