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
| Setting | Type | Default | Description |
|---|---|---|---|
| Scale | float | 1.0 | Uniform scale factor applied on import |
| Axis | enum | YUp | Source up-axis convention |
| Apply Unit Scale | bool | true | Apply source file unit scaling |
| Triangulate | bool | true | Convert polygons to triangles |
| Weld Vertices | bool | true | Merge duplicate vertices |
| Weld Threshold | float | 0.0001 | Vertex merge threshold |
| Normals | enum | Recalculate | Import or recalculate normals |
| Single Material | bool | true | Required for sources with multiple material slots; the current importer publishes one PS1 material per model |
| PS1 optimization recipe | optimizer window | disabled | Generate 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
- Place
.objor.fbxfiles inAssets/Models/. - Select the model in the Project panel.
- Adjust import settings in the Inspector.
- For a dense static mesh, click Open PS1 Asset Optimizer, choose an asset role, compare the source, recommended, and generated counts, then generate.
- Apply or reimport.
- Review repaired vertex/triangle counts and any PS1 warnings.
- Create a GameObject from the model or assign it to a Mesh Renderer.
- 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.