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 (.obj) for simple static meshes.
  • FBX (.fbx) for static meshes and the bounded hard-skinned animation path.

Blender project files, glTF/GLB, and Unity packages/prefabs are not model import formats. Export the mesh as OBJ or FBX and import its textures separately. See Supported File Formats for conversion guidance.

Both supported formats are 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.

The importer preserves authored OBJ/FBX face order, including inward room shells and open surfaces, with or without a normals stream. Recalculate changes shading normals only. Both the editor and PS1 use the standard cross(B-A, C-A) front face; screen-Y conversion and texture-V origin conversion are separate. Only reflected import transforms reverse corners to preserve the visible side. Outdated mesh caches are reimported when their importer revision changes.

Last Exit includes Authoring/LastExit.blend, assembled room scenes, source texture atlases and offline authoring scripts. Its normal OBJ import path keeps metre units, UVs, hinged door/handle/lid pivots and GUID references. Do not import the .blend directly. Read Authoring/README.md in an editable example copy.

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 MaterialbooltrueCollapse source material slots into one; disable to preserve editable material slots on static meshes. Skinned output still requires one material
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.

Rejected geometry and PS1 precision​

For duplicate faces, invalid connections, inconsistent orientation, weld-related collapsed faces, damaged vertex data, skinning, or forced symmetry, follow the model diagnosis and repair guide. It explains how to inspect each case in the source model and verify a successful reimport. Open planes and consistently inward-facing rooms are valid.

If import or Level Builder export reports collapses at PS1 vertex precision, a triangle that has area in the source becomes a line or a point after PS1 coordinate conversion. A mesh with tiny details and very large bounds, or one whose vertices are far from its own origin, can hit this limit even with few triangles.

  • Recenter the vertices around the model's local origin in your modeling tool; use the GameObject's Transform to place it in the level.
  • Split large environments into smaller meshes with local origins.
  • Enlarge or simplify extremely thin details, then reimport and review the result in the game. Increasing subdivision alone does not restore precision.
  • Fix invalid indices or non-finite position, normal, and UV values in the source model before exporting it again.

A rejected conversion leaves the previous successful imported asset in place. Resolve the error and reimport successfully before building; the old preview does not mean your latest model changes were accepted. Triangle recommendations above are planning limits, not promises of a particular frame rate.

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. Select Apply & Import after changing settings, or Reimport after correcting the source.
  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.

Camera-angle visibility​

The renderer automatically checks ambiguous pixel-rounded face orientation in 3D and clips visible portions against the camera frustum. Existing meshes do not need flipped faces, double-sided materials, or per-object depth offsets for this correction; rebuild the project with the current engine. Editor previews also keep shared clipping intersections consistent and do not displace vertices to simulate affine textures.

Integer-pixel movement and affine texture distortion remain PS1 characteristics. This does not remove the geometry/precision constraints above or give the PS1 a hardware depth buffer.

UV fidelity and source corrections​

Normal OBJ/FBX import preserves the authored UV islands and seams. Conversion changes the texture-V origin to the engine convention and stores coordinates at PS1 precision; it does not automatically unwrap or repack the model. Newly split vertices interpolate the existing mapping. Keep source UVs within the supported 0..1 range: coordinates outside it are clamped, not repeated across texture tiles. The import warning UVs outside [0,1] will be clamped means the source needs atlas mapping or another layout that fits that range.

If a frame, shelf or wall is stretched in Blender too, correct its UV proportions and texel density there, export again and reimport. A higher texture resolution alone does not fix a narrow UV island stretched over a large face. If an object looks inside-out, inspect the source face orientation; recalculating shading normals does not reverse its winding. Use double-sided materials only when both sides are part of the intended surface.

The renderer also applies bounded camera-adaptive subdivision to textured geometry without editing the imported asset. This reduces perspective warping; it does not repair UVs, create image detail, or remove arbitrary intersections. See Rendering and Level Authoring and Texture Import.