tinyobjloader parses Wavefront .obj and .mtl 3D model files for renderers and tools. It offers a single-header C++ loader and a separate pure C11 implementation with tessellation support.
Overview
tinyobjloader loads Wavefront OBJ geometry and companion MTL materials into structures your renderer or tool can consume. The C++ path centers on tinyobjloader.h, a header-only parser that needs only the standard library and handles very large meshes in benchmarking examples.
A newer pure C11 implementation, tinyobjc with the tobjtess tessellation library, targets embedded or freestanding builds. It can run without libc in the core, supports float and double precision, and parses faces, lines, points, and retained free-form curve and surface records.
Features include grouping, vertex attributes, texture coordinates, normals, smoothing groups, optional double precision, callback-driven loading, PBR extensions for MTL, and polygon triangulation with an optional Mapbox earcut path for difficult faces. An optimized LoadObjOpt entry point adds multithreading and SIMD for huge files while keeping the same mesh layout.
Python bindings are included, and examples cover an OpenGL viewer, callback APIs, and voxelization. The library is intended to embed directly into global illumination renderers, game engines, or offline conversion pipelines by copying the header or linking the C sources.
Key features
- Single-header C++ OBJ parser
- Pure C11 freestanding loader
- MTL materials with PBR extension
- Polygon triangulation options
- Callback-based custom loading
- LoadObjOpt multithreaded parser
- Python bindings
- Double-precision mesh data
Use cases
- Embedding OBJ import in renderers
- Loading large architectural scenes
- C or C++ game engine tooling
- Offline mesh inspection utilities
- Embedded 3D asset pipelines