Expand description
TMF: 3D model format, compressing meshes by up to 89%!
§What is the goal of tmf
TMF is a lossy file format focused on:
- High compression without sacrificing model looks
- Very high decode speeds
- Simplicity, both of the API, and underlying compression methods.
- Being explicit: no change to a model may occur without it being explicitly allowed by the user. This does increase complexity of the API slightly, but also makes changes in models more clear.
§Feature flags
triangulation
— Experimental triangulation in .obj loader. Supports only convex polygons ATM, and has bugs, triangulating your mesh in 3D modelling software before importing highly advised. Please note that if you see any triangles missing this is likely the result of the triangulation algorithm not working properly.fast_trig
— Changes the sin and cos function used in reading the tmf files for a potentially faster, but less accurate functions.double_precision
— Changes the precision of read data from single to double point precision.long_indices
— Changes the index format to long(u64) in order to support reading models with over 2^32 - 1 points, at cost of increased memory footprint.short_indices
— Changes the index format to short(u16), decreasng memory footprint, but limiting max model vertex count to 2^16 - 1(65535).byte_rw
— Changes the internal setting of the unaligned reader to use different data size. Can be beneficial for small models on some systems.obj_import
(enabled by default) — Adds the ability to import/export .obj files.tokio_runtime
— Use the tokio runtime, significantly increasing performance of synchronous loads, at the cost of minor compile time increase.
Structs§
- Normal
Precision Mode - Setting dictating how much can any normal in a model deviate, expressed as an angle.
- TMFMesh
- Representation of a TMF mesh. Can be loaded from disk, imported from diffrent format, saved to disk, and exported to a diffrent format, or created using special functions. Any mesh created at run time should but does not have to be checked before saving with
Self::verify
call. If the mesh is known to be OK before saving this step can be skipped(even tough it is still advised). - TMFPrecision
Info - Settings for saving of a TMF mesh.
- Tangent
Precision Mode - A value specifying how precise saved (x,y,z) values must be.
- UvPrecision
Mode - Setting dictating how precisely the UV coordinates should be saved.
- Vertex
Precision Mode - Setting dictating how much the length of any edge can change because of vertex precision loss during saving. This is expressed as a fraction of the length of the shortest edge.
Enums§
- Custom
Data - Custom mesh data.
- Data
Segment Error - An enum representing error, which occurred while adding a segment counting custom mesh data.
- TMFExport
Error - An error which occured when a
TMFMesh
is exported. - TMFImport
Error - An enum describing an error that occurred during loading a TMF mesh.
- TMFIntegrity
Status - Enum representing the result of integrity check.
Type Aliases§
- Float
Type - Type used for representing floating-point numbers.
- Handedness
Type - A value describing handedness of tangent.
- Index
Type - Index type used for representing triangle indices.
- Tangent
- A representation of a Tangent.
- Vector2
- Type used for representing 2d floating-point vectors
- Vector3
- Type used for representing 3d floating-point vectors
- Vector4
- Type used for representing 4d floating-point vectors