Skip to main content

Model Import

Polygon Engine imports source models into compact .msh assets that the editor and PS1 runtime can load by GUID.

Supported Formats

  • OBJ for simple static meshes.
  • FBX for static meshes and the bounded hard-skinned animation path.

Models are imported through Assimp, converted to runtime mesh data, and tracked in Library/asset_db.json.

During conversion, the importer also repairs T-junction edges: when a vertex lies on another triangle's edge, the edge is split and the new vertex receives interpolated normal and UV data. This reduces PS1 raster cracks without requiring the source application to use Polygon Engine's exact subdivision.

Import Settings

SettingTypeDefaultDescription
Scalefloat1.0Uniform scale factor applied on import
AxisenumYUpSource up-axis convention
Apply Unit ScalebooltrueApply source file unit scaling
TriangulatebooltrueConvert polygons to triangles
Weld VerticesbooltrueMerge duplicate vertices
Weld Thresholdfloat0.0001Vertex merge threshold
NormalsenumRecalculateImport or recalculate normals
Single MaterialbooltrueRequired for sources with multiple material slots; the current importer publishes one PS1 material per model
PS1 optimization recipeoptimizer windowdisabledGenerate a constrained lower-poly runtime copy; Generate Optimized Output enables the recipe

FBX sources also expose Import Hard-Skinned Animation and a 1..30 Target FPS when skeletal data is present. See Skeletal Animation before enabling it; animated output has separate material, bone, geometry, and matrix limits.

Runtime Mesh Format

Imported and Level Builder meshes use the runtime mesh magic PGMSH1.

The file stores:

  • header with version, vertex count, index count, flags, position scale, and bounds,
  • vertices with fixed-point position data, optional normals, and UVs,
  • 16-bit triangle indices.

The runtime validates the magic, counts, index range, and data size before using the mesh.

PS1 Constraints

  • Maximum hard vertex index range is 65,535.
  • Maximum hard runtime sort range is 2,048 triangles per mesh.
  • The source importer uses a wider working representation, so a dense source can be simplified before the 65,535-vertex runtime limit is enforced.
  • Recommended soft limit is 2,000 triangles per individual mesh.
  • Recommended soft limit is 4,000 scene triangles unless the scene is carefully optimized.
  • Long triangles and giant surfaces are more fragile on the PS1 ordering table.
  • Split large floors and walls into sensible chunks.
  • T-junction repair can increase the final vertex/index counts; inspect the imported stats rather than assuming the DCC counts are unchanged.
  • Coplanar or deeply intersecting objects remain ordering-sensitive even when each individual mesh is valid.

Workflow

  1. Place .obj or .fbx files in Assets/Models/.
  2. Select the model in the Project panel.
  3. Adjust import settings in the Inspector.
  4. For a dense static mesh, click Open PS1 Asset Optimizer, choose an asset role, compare the source, recommended, and generated counts, then generate.
  5. Apply or reimport.
  6. Review repaired vertex/triangle counts and any PS1 warnings.
  7. Create a GameObject from the model or assign it to a Mesh Renderer.
  8. Add a Collider when the player should touch or block against it.

For the full reduction workflow, constraints, and troubleshooting, see PS1 Asset Optimizer. For in-editor mesh creation, see Level Builder. For animated FBX setup, see Skeletal Animation.