Forge Pipeline Skinned Animations 标志

Forge Pipeline Skinned Animations

社区
Nebulavenus
forge-pipeline-skinned-animations

使用预处理的 .fskin/.fanim 资源和 ForgeSceneSkinnedModel,为 SDL GPU 项目添加基于管线的骨骼动画。

概览

发布者Nebulavenus
代码仓库forge-gpu
技能名称forge-pipeline-skinned-animations
星标数
46
复刻数
7
附带文件
仅含指令
许可协议Zlib
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 Nebulavenus 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Forge Pipeline Skinned Animations AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-pipeline-skinned-animations
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Nebulavenus/forge-gpu.git /tmp/forge-gpu
mkdir -p .claude/skills
cp -r /tmp/forge-gpu/.claude/skills/forge-pipeline-skinned-animations .claude/skills/forge-pipeline-skinned-animations
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Forge Pipeline Skinned Animations,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Forge Pipeline Skinned Animations。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Forge Pipeline Skinned Animations 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Add skeletal animation using pre-processed pipeline assets (.fmesh v3, .fskin, .fanim) and the ForgeSceneSkinnedModel API in forge_scene.h. Joint matrices are computed on the CPU each frame and uploaded to a GPU storage buffer for vertex-stage skinning. Use this skill when you need animated characters or creatures with the pipeline asset workflow, or when you need transform-only animation on non-skinned models.

See GPU Lesson 43 — Pipeline Skinned Animations for the full walkthrough. For glTF-based skinning (without the pipeline), see GPU Lesson 32 — Skinning Animations.

Key API calls

FunctionPurpose
forge_scene_load_skinned_model()Load skinned model from .fscene + .fmesh + .fmat + .fskin + .fanim
forge_scene_update_skinned_animation()Advance time, evaluate keyframes, upload joint matrices
forge_scene_draw_skinned_model()Draw skinned model in main pass (binds joint storage buffer)
forge_scene_draw_skinned_model_shadows()Draw skinned model into shadow map
forge_scene_free_skinned_model()Release all GPU + CPU resources
forge_pipeline_anim_apply()Evaluate animation channels at time t (for transform-only use)
forge_pipeline_scene_compute_world_transforms()Propagate hierarchy after animation
forge_pipeline_compute_joint_matrices()Compute joint_matrix[i] = inv(mesh_world) × joint_world × IBM[i]

Skinned vertex layout (72 bytes)

c
/* Pipeline skinned vertex — 72-byte stride */
/* offset  0: float3  position   (12 bytes) */
/* offset 12: float3  normal     (12 bytes) */
/* offset 24: float2  uv         ( 8 bytes) */
/* offset 32: float4  tangent    (16 bytes) */
/* offset 48: uint16×4 joints    ( 8 bytes) */
/* offset 56: float4  weights    (16 bytes) */

Vertex attributes (all TEXCOORD semantics):

  • Location 0: FLOAT3 at offset 0 (position)
  • Location 1: FLOAT3 at offset 12 (normal)
  • Location 2: FLOAT2 at offset 24 (uv)
  • Location 3: FLOAT4 at offset 32 (tangent)
  • Location 4: USHORT4 at offset 48 (joints)
  • Location 5: FLOAT4 at offset 56 (weights)

Loading a skinned model

c
#define FORGE_PIPELINE_IMPLEMENTATION
#include "pipeline/forge_pipeline.h"

#define FORGE_SCENE_MODEL_SUPPORT
#define FORGE_SCENE_IMPLEMENTATION
#include "scene/forge_scene.h"

ForgeSceneSkinnedModel model;
if (!forge_scene_load_skinned_model(&scene, &model,
        "assets/Model/Model.fscene",
        "assets/Model/Model.fmesh",
        "assets/Model/Model.fmat",
        "assets/Model/Model.fskin",
        "assets/Model/Model.fanim",
        "assets/Model")) {
    SDL_Log("Failed to load skinned model");
    return SDL_APP_FAILURE;
}

Per-frame animation update

c
/* Set animation parameters */
model.anim_speed = 1.0f;
model.looping = true;

/* Evaluate keyframes, propagate hierarchy, upload joint matrices */
forge_scene_update_skinned_animation(&scene, &model, dt);

Drawing

c
mat4 placement = mat4_multiply(
    mat4_translate(vec3_create(0, 0, 0)),
    mat4_scale_uniform(1.0f));

/* Shadow pass */
forge_scene_begin_shadow_pass(&scene);
forge_scene_draw_skinned_model_shadows(&scene, &model, placement);
forge_scene_end_shadow_pass(&scene);

/* Main pass */
forge_scene_begin_main_pass(&scene);
forge_scene_draw_skinned_model(&scene, &model, placement);
forge_scene_end_main_pass(&scene);

Shader pattern (vertex)

The skinned vertex shader reads joint matrices from a storage buffer (StructuredBuffer) rather than a uniform buffer, supporting up to 256 joints:

hlsl
StructuredBuffer<float4x4> joint_mats : register(t0, space0);

float4x4 skin_mat =
    input.weights.x * joint_mats[input.joints.x] +
    input.weights.y * joint_mats[input.joints.y] +
    input.weights.z * joint_mats[input.joints.z] +
    input.weights.w * joint_mats[input.joints.w];

float4 skinned_pos = mul(skin_mat, float4(input.position, 1.0));
float3 skinned_nrm = normalize(mul((float3x3)skin_mat, input.normal));
float3 skinned_tan = normalize(mul((float3x3)skin_mat, input.tangent.xyz));

Transform animation (non-skinned models)

For models with animation but no skin (e.g., a rotating cube), load the animation separately and apply it manually:

c
ForgeSceneModel model;
ForgePipelineAnimFile anim;
float anim_time = 0.0f;

if (!forge_scene_load_model(&scene, &model, fscene, fmesh, fmat, base_dir)) {
    SDL_Log("Failed to load model");
    return SDL_APP_FAILURE;
}
if (!forge_pipeline_load_animation(fanim_path, &anim)) {
    SDL_Log("Failed to load animation");
    forge_scene_free_model(&scene, &model);
    return SDL_APP_FAILURE;
}

/* Each frame */
anim_time += dt;
if (anim.clip_count > 0) {
    forge_pipeline_anim_apply(&anim.clips[0],
        model.scene_data.nodes, model.scene_data.node_count,
        anim_time, true);
}
forge_pipeline_scene_compute_world_transforms(
    model.scene_data.nodes, model.scene_data.node_count,
    model.scene_data.roots, model.scene_data.root_count,
    model.scene_data.children, model.scene_data.child_count);

/* Draw with a model-level placement — node animation is applied
 * internally via the scene_data.nodes[*].world_transform values
 * that forge_pipeline_anim_apply() + compute_world_transforms() wrote. */
mat4 placement = mat4_identity();  /* or any model-level transform */
forge_scene_draw_model(&scene, &model, placement);

Pipeline files

FileContent
.fmesh v3Skinned vertices (72-byte stride, FORGE_PIPELINE_FLAG_SKINNED)
.fskinJoint hierarchy, inverse bind matrices, skin-to-node mapping
.fanimKeyframe clips with per-channel TRS data
.fsceneScene node hierarchy (parents, transforms)
.fmatMaterial definitions (colors, texture references)

Generate these from glTF source using:

bash
forge_mesh_tool model.gltf model.fmesh --verbose
forge_scene_tool model.gltf model.fscene --skins --verbose
forge_anim_tool model.gltf model.fanim --verbose

Common mistakes

  • Missing --skins flag — forge_scene_tool must be run with --skins to generate the .fskin file. Without it, joint hierarchy data is missing.
  • Pipeline quaternion order — Pipeline stores quaternions as [x, y, z, w], matching glTF. The forge math library uses quat(w, x, y, z) with w first. The pipeline evaluation functions handle this conversion internally.
  • Forgetting shadow skinning — Use forge_scene_draw_skinned_model_shadows() for the shadow pass. Using the non-skinned shadow draw produces a static bind-pose shadow.
  • Non-skinned model with animation — Do not use ForgeSceneSkinnedModel for models without a skin. Instead, load as ForgeSceneModel and apply animation with forge_pipeline_anim_apply() manually.

常见问题

Forge Pipeline Skinned Animations AI 技能有什么作用?

使用预处理的 .fskin/.fanim 资源和 ForgeSceneSkinnedModel,为 SDL GPU 项目添加基于管线的骨骼动画。

为什么在 TypingMind 中使用 Forge Pipeline Skinned Animations?

因为您只需安装一次,就能搭配任何模型使用。Forge Pipeline Skinned Animations 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Forge Pipeline Skinned Animations?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-pipeline-skinned-animations。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Forge Pipeline Skinned Animations?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Forge Pipeline Skinned Animations 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Forge Pipeline Skinned Animations 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Forge Pipeline Skinned Animations AI 技能免费吗?

是的。Nebulavenus 已在 GitHub 上根据 Zlib 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇