|
Toast Engine
|
Represents 3D geometry data, can be read from a .tmesh binary file. More...
#include "core_types.hpp"#include <glm/glm.hpp>#include <memory>#include <toast/export.hpp>#include <toast/log.hpp>#include <toast/renderer/vertex.hpp>

Go to the source code of this file.
Classes | |
| struct | assets::_detail::MeshFileHeader |
| Fixed 16-byte .tmesh header. More... | |
| class | assets::Mesh |
Functions | |
| void | assets::generateTangents (std::vector< renderer::Vertex > &vertices, const std::vector< uint32_t > &indices) |
| Derives per-vertex tangents from UVs, for geometry that arrived without them. | |
Variables | |
| constexpr uint16_t | assets::_detail::mesh_format_version = 7 |
Represents 3D geometry data, can be read from a .tmesh binary file.
| TOAST_API void assets::generateTangents | ( | std::vector< renderer::Vertex > & | vertices, |
| const std::vector< uint32_t > & | indices ) |
Derives per-vertex tangents from UVs, for geometry that arrived without them.
glTF expects the client to generate these when a material has no normal map, and exporters take that literally. The shader survives a missing tangent only by inventing a basis, which points any normal map it does have in a meaningless direction
The standard accumulate-and-orthonormalize scheme, not MikkTSpace - it differs on mirrored UV seams and hard edges, so a mesh baked against MikkTSpace is still better off exporting real tangents
| vertices | Modified in place; only the tangent member is written |
| indices | Triangle list; a trailing partial triangle is ignored |
|
inlineconstexpr |
The one .tmesh version this build reads or writes. Older ones are rejected with a reimport message rather than read best-effort, because a mismatched SkinVertex stride misparses instead of failing cleanly
Layout: header, uint8 name length, name, vertex_count Vertex, index_count uint32, uint32 skin vertex count + that many SkinVertex (0 for a static mesh)