forge-pipeline-assets
Load and render .fmesh binary meshes and pipeline-processed textures in SDL GPU applications
от Nebulavenus★ 51 звезда на GitHub
Установить forge-pipeline-assets в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Skill: Pipeline-Processed Assets
Load and render .fmesh binary meshes, .fmat material sidecars, and
pipeline-processed textures in SDL GPU applications. This pattern replaces
raw glTF loading with optimized binary assets produced by the forge-gpu
asset pipeline.
When to use
- Loading mesh assets processed by
forge-mesh-tool(.fmeshv2 format) - Loading material data from
.fmatsidecars (texture paths, PBR parameters) - Loading textures with
.meta.jsonsidecar metadata - Setting up dual vertex formats (48-byte with tangents, 32-byte without)
- Implementing LOD selection based on camera distance
- Normal mapping with Gram-Schmidt TBN from pipeline tangent data
Key files
| File | Purpose |
|---|---|
common/pipeline/forge_pipeline.h |
Runtime loader for .fmesh + .fmat + textures |
tools/mesh/main.c |
CLI tool that generates .fmesh + .fmat from OBJ/glTF |
lessons/gpu/39-pipeline-processed-assets/main.c |
Reference implementation |
Key API calls
forge_pipeline_load_mesh(path, &mesh)— load.fmeshv2 binary into CPU structforge_pipeline_free_mesh(&mesh)— release CPU-side mesh dataforge_pipeline_has_tangents(&mesh)— check if mesh has 48-byte tangent verticesforge_pipeline_lod_index_count(&mesh, lod)— get index count for a LOD levelforge_pipeline_lod_indices(&mesh, lod)— get index pointer for a LOD levelforge_pipeline_load_materials(path, &set)— load.fmatmaterial sidecarforge_pipeline_free_materials(&set)— release CPU-side material dataforge_pipeline_load_texture(path, &tex)— load texture via.meta.jsonsidecarforge_pipeline_free_texture(&tex)— release CPU-side texture data
Pattern
1. Include the pipeline library
/* In exactly ONE .c file: */
#define FORGE_PIPELINE_IMPLEMENTATION
#include "pipeline/forge_pipeline.h"
2. Load a .fmesh mesh
ForgePipelineMesh mesh;
if (!forge_pipeline_load_mesh("model.fmesh", &mesh)) {
/* handle error */
}
/* Check vertex format */
if (forge_pipeline_has_tangents(&mesh)) {
/* 48-byte stride: position + normal + uv + tangent */
ForgePipelineVertexTan *verts = (ForgePipelineVertexTan *)mesh.vertices;
} else {
/* 32-byte stride: position + normal + uv */
ForgePipelineVertex *verts = (ForgePipelineVertex *)mesh.vertices;
}
/* Upload to GPU */
SDL_GPUBuffer *vb = upload_gpu_buffer(device, SDL_GPU_BUFFERUSAGE_VERTEX,
mesh.vertices, mesh.vertex_count * mesh.vertex_stride);
/* Access LOD levels */
for (uint32_t lod = 0; lod < mesh.lod_count; lod++) {
uint32_t count = forge_pipeline_lod_index_count(&mesh, lod);
const uint32_t *indices = forge_pipeline_lod_indices(&mesh, lod);
}
/* Cleanup */
forge_pipeline_free_mesh(&mesh);
3. Load materials from .fmat sidecar
ForgePipelineMaterialSet materials;
if (!forge_pipeline_load_materials("model.fmat", &materials)) {
/* handle error */
}
/* Use material texture paths (not hardcoded filenames) */
for (uint32_t i = 0; i < materials.material_count; i++) {
ForgePipelineMaterial *mat = &materials.materials[i];
if (mat->base_color_texture[0]) {
/* Extract filename, resolve in processed directory */
const char *fname = filename_from_path(mat->base_color_texture);
load_pipeline_texture(device, fname, /*srgb=*/true);
}
if (mat->normal_texture[0]) {
const char *fname = filename_from_path(mat->normal_texture);
load_pipeline_texture(device, fname, /*srgb=*/false);
}
}
/* Cleanup */
forge_pipeline_free_materials(&materials);
4. Load a pipeline texture (via .meta.json sidecar)
ForgePipelineTexture tex;
if (!forge_pipeline_load_texture("diffuse.png", &tex)) {
/* handle error — needs diffuse.meta.json sidecar */
}
/* Decode mip 0 (currently PNG bytes) */
SDL_IOStream *io = SDL_IOFromMem(tex.mips[0].data, tex.mips[0].size);
SDL_Surface *surface = SDL_LoadSurface_IO(io, false);
if (!surface) {
/* decode failed — fall back to loading from disk */
SDL_CloseIO(io);
forge_pipeline_free_texture(&tex);
surface = SDL_LoadSurface("diffuse.png");
} else {
SDL_CloseIO(io);
forge_pipeline_free_texture(&tex);
}
5. Generate .fmesh + .fmat files
# From glTF with LOD levels and tangent generation
./build/tools/mesh/forge_mesh_tool \
input.gltf output.fmesh \
--lod-levels 1.0,0.5,0.25 --verbose
# Creates output.fmesh + output.fmat + output.meta.json
6. Create .meta.json sidecars for textures
{
"width": 1024,
"height": 1024,
"format": "rgba8",
"mips": [
{ "level": 0, "width": 1024, "height": 1024, "file": "texture.png" }
]
}
Vertex formats
| Format | Stride | Fields | Use case |
|---|---|---|---|
| No tangent | 32 bytes | pos(12) + normal(12) + uv(8) | Basic Blinn-Phong |
| With tangent | 48 bytes | pos(12) + normal(12) + uv(8) + tangent(16) | Normal mapping |
LOD selection
uint32_t sel
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл forge-pipeline-assets?
Load and render .fmesh binary meshes and pipeline-processed textures in SDL GPU applications
Как установить скилл forge-pipeline-assets?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл forge-pipeline-assets запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
AnthropicThe scan that the plugin's GitHub Action runs.
azure-static-web-apps
GitHubHelps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
ai-ready
GitHubMake any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
aws-cdk-python-setup
GitHubSetup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…