![]() |
TGX 1.1.1
A tiny 2D/3D graphics library optimized for 32 bits microcontrollers.
|
Header for a single meshlet inside a Mesh3Dv2 object. More...
#include <Mesh3Dv2.h>
Public Attributes | |
| int16_t | sphere_center [3] |
| Quantized bounding sphere center relative to the global bounding-box center. | |
| int16_t | cone_dir [3] |
| Signed-normalized quantized visibility cone direction. | |
| uint16_t | sphere_radius |
| Quantized bounding sphere radius. | |
| int16_t | cone_cos |
| Signed-normalized cone cosine. Values <= -32767 disable meshlet cone culling. | |
| uint32_t | payload_offset32 |
| Offset of this meshlet payload in Mesh3Dv2::payload, in 32-bit words. | |
| uint8_t | nb_vertices |
| Number of local vertices. With the uint8_t face stream format, this must be <= 128. | |
| uint8_t | nb_normals |
| Number of local normals. | |
| uint8_t | nb_texcoords |
| Number of local texture coordinates. | |
| uint8_t | material_index |
| Index in Mesh3Dv2::materials. | |
Header for a single meshlet inside a Mesh3Dv2 object.
Meshlet headers are stored in a compact linear array and are read before touching the meshlet payload. This makes it possible to reject invisible meshlets quickly using the bounding sphere and visibility cone.
The sphere and cone metadata are quantized relative to the mesh global bounding box. The renderer reconstructs this metadata before it touches the meshlet payload:
A cone_cos value below or equal to -1 disables meshlet cone culling. The payload offset is expressed in 32-bit words into Mesh3Dv2::payload. This guarantees that every meshlet payload starts on a 4-byte boundary when Mesh3Dv2::payload points to a uint32_t array. The payload generator must also pad each meshlet payload to a multiple of 4 bytes.