{"id":50465816,"url":"https://github.com/qbart/assetc","last_synced_at":"2026-06-01T07:04:29.087Z","repository":{"id":358349168,"uuid":"1239229571","full_name":"qbart/assetc","owner":"qbart","description":"Asset Compiler that turns raw assets into runtime friendly formats for Games.","archived":false,"fork":false,"pushed_at":"2026-05-16T22:25:39.000Z","size":350,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-17T00:37:12.873Z","etag":null,"topics":["array","asset-compilation","assets","bc","cubemap","glb","gltf","gltf2","ktx","ktx-library","ktx2","material","slang","uastc","vulkan"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qbart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-14T22:22:49.000Z","updated_at":"2026-05-16T22:25:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/qbart/assetc","commit_stats":null,"previous_names":["qbart/assetc"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/qbart/assetc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbart%2Fassetc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbart%2Fassetc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbart%2Fassetc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbart%2Fassetc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qbart","download_url":"https://codeload.github.com/qbart/assetc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qbart%2Fassetc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33763681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","asset-compilation","assets","bc","cubemap","glb","gltf","gltf2","ktx","ktx-library","ktx2","material","slang","uastc","vulkan"],"created_at":"2026-06-01T07:04:28.373Z","updated_at":"2026-06-01T07:04:29.082Z","avatar_url":"https://github.com/qbart.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Asset Compiler\n\n`assetc` compiles source assets under `assets/` (textures, meshes, shaders, materials) into runtime-friendly binary formats written to `runtime/`. Images become UASTC-encoded `.ktx2`, meshes become `.hmesh` with octahedral-packed normals/tangents and meshletized geometry; mesh files reference materials by stable 64-bit hashes so the engine can share resources across assets.\n\n## .hmesh file format (v1)\n\nLittle-endian, tagged-chunk container. Magic `\"HMSH\"` (`0x4853'4D48`).\n\n### Top-level layout\n\n```\n+--------------------------------+\n| FileHeader     (32 B)          |\n+--------------------------------+\n| ChunkTable     (24 B * N)      |\n+--------------------------------+\n| Chunk payloads (16 B aligned)  |\n+--------------------------------+\n```\n\n### FileHeader (32 B)\n\n| Offset | Field        | Type | Notes                                  |\n| -----: | ------------ | ---- | -------------------------------------- |\n|      0 | `magic`      | u32  | `\"HMSH\"` (`0x4853'4D48`)               |\n|      4 | `version`    | u32  | `1`                                    |\n|      8 | `chunkCount` | u32  | number of entries in ChunkTable        |\n|     12 | `flags`      | u32  | reserved                               |\n|     16 | `_reserved1` | u64  | reserved (was `contentHash`, held)     |\n|     24 | `_reserved2` | u64  | reserved                               |\n\n### ChunkEntry (24 B each)\n\n| Offset | Field    | Type | Notes                                |\n| -----: | -------- | ---- | ------------------------------------ |\n|      0 | `fourcc` | u32  | `ChunkId` value (see below)          |\n|      4 | `flags`  | u32  | per-chunk flags (compression hint)   |\n|      8 | `offset` | u64  | byte offset from file start          |\n|     16 | `size`   | u64  | payload bytes                        |\n\nChunks are written in any order, padded to 16-byte alignment between payloads. Unknown chunks are ignored by readers (forward compatibility).\n\n### Chunk catalogue (v1)\n\n| FourCC | Purpose            | Payload                                                                 |\n| ------ | ------------------ | ----------------------------------------------------------------------- |\n| `BNDS` | mesh bounds        | `MeshBounds` (40 B): AABB min/max (`vec3`) + sphere center/radius       |\n| `VTXS` | vertex stream      | `u32 count`, `u32 stride`, then `count * stride` bytes (`GpuVertex[]`)  |\n| `IDXS` | index stream       | `u32 count`, `u32 size`, then `count * size` bytes (`size` = 2 or 4)    |\n| `MLET` | meshlets           | `Meshlet[]`: per-meshlet vertex/triangle offsets and counts             |\n| `MLVR` | meshlet vertices   | `u32[]`: per-meshlet local-to-global vertex index remap                 |\n| `MLTR` | meshlet triangles  | `MeshletTriangle[]`: 3 × u8 per triangle, dense (no inter-meshlet pad)  |\n| `MLBN` | meshlet bounds     | `MeshletBounds[]`: per-meshlet center/radius + cone-cull axis/cutoff    |\n| `MTRL` | material refs      | `u32 count`, then `count * u64` (FNV1a64 of material runtime refs)      |\n\n### `GpuVertex` (36 B)\n\n| Offset | Field      | Type      | Notes                                                  |\n| -----: | ---------- | --------- | ------------------------------------------------------ |\n|      0 | `position` | f32 × 3   | object-local position (no quantization in v1)          |\n|     12 | `normal`   | i16 × 4   | `[0..1]` octahedral normal (SNORM); `[2..3]` reserved  |\n|     20 | `tangent`  | i16 × 4   | `[0..1]` octahedral tangent + handedness in bit 0;     |\n|        |            |           | `[2..3]` reserved                                      |\n|     28 | `uv`       | f32 × 2   | UV0 (top-left origin, matches Vulkan)                  |\n\nSuggested Vulkan vertex input formats: normal → `VK_FORMAT_R16G16_SNORM`, tangent → `VK_FORMAT_R16G16_SINT` (shader needs raw integer access to extract the handedness bit).\n\n### Material refs\n\nThe `MTRL` chunk holds FNV1a64 hashes — one per material in the source file, in source-index order. The hash input is a canonical runtime ref of the form `\u003csourceRef\u003e/\u003cleaf\u003e` where:\n\n- `sourceRef` is the source asset's runtime path with `assets/` prefix stripped, extension dropped, lowercased, `/`-separated (e.g. `models/chair`).\n- `leaf` is the lowercased material name if non-empty AND unique within the source's material array; otherwise `material_\u003cindex\u003e`.\n\nExample: `assets/models/chair.glb` with materials `[\"Wood\", \"\", \"Leather\", \"Wood\"]` produces `MTRL = [hash(\"models/chair/material_0\"), hash(\"models/chair/material_1\"), hash(\"models/chair/leather\"), hash(\"models/chair/material_3\")]`.\n\n### Endianness\n\nLittle-endian only. `src/assetc/runtime_mesh.cpp` enforces this with a `static_assert(std::endian::native == std::endian::little)`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqbart%2Fassetc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqbart%2Fassetc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqbart%2Fassetc/lists"}