<p><a href="https://github.com/KhronosGroup/glTF/blob/master/README.md" rel="nofollow noreferrer">glTF</a> is capable if embedding both geometry and texture data in a single file. It also has binary version (*.glb). There are several open-source savers/loaders, one of them being header-only <a href="https://github.com/syoyo/tinygltf" rel="nofollow noreferrer">tinygltf</a> by Syoyo Fujita.</p>

CC BY-SA 4.0
2020-01-07T11:12:53.437Z
2020-01-07T11:12:53.437Z
ivokabel
<p>I'm looking for a format where I could store a triangle mesh and multiple textures into a single file. Most formats only reference an external file for textures. I found that the FBX format should support this, but I need something with an open-source C++ library. And by single file I don't mean putting it into a single archive, I don't want users to have to deal with that.</p>

<p>I don't need anything fancy, no animation, no shading, nothing. Just triangles + textures. Ideally this would be a binary format (or at least the textures would be stored in binary inside the file). This should be some well supported format, so that tools exist to open it. I'm currently looking at X3D but I can't figure out if it can include the textures directly.</p>

<mesh>
Saving a mesh and textures into a single file
M.K.
# Saving a mesh and textures into a single file

(Asked by: username_0 on 2020-01-07)

I'm looking for a format where I could store a triangle mesh and multiple textures into a single file. Most formats only reference an external file for textures. I found that the FBX format should support this, but I need something with an open-source C++ library. And by single file I don't mean putting it into a single archive, I don't want users to have to deal with that.

I don't need anything fancy, no animation, no shading, nothing. Just triangles + textures. Ideally this would be a binary format (or at least the textures would be stored in binary inside the file). This should be some well supported format, so that tools exist to open it. I'm currently looking at X3D but I can't figure out if it can include the textures directly.

**Tags:** mesh


---

## 1 answers

### Answer by username_1 on 2020-01-07. Score: 3 | Accepted answer

[glTF](https://github.com/KhronosGroup/glTF/blob/master/README.md) is capable if embedding both geometry and texture data in a single file. It also has binary version (\*.glb). There are several open-source savers/loaders, one of them being header-only [tinygltf](https://github.com/syoyo/tinygltf) by Syoyo Fujita.


---

