Forge Skinning Animationsのロゴ

Forge Skinning Animations

コミュニティ
Nebulavenus
forge-skinning-animations

glTFのジョイント階層、逆バインド行列、頂点ごとのブレンドウェイトを使ったスケルタルスキニングアニメーションをSDL GPUプロジェクトに追加します。

概要

公開者Nebulavenus
リポジトリforge-gpu
スキル名forge-skinning-animations
スター
46
フォーク
7
同梱ファイル
指示のみ
ライセンスZlib
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    NebulavenusがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Forge Skinning Animations」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-skinning-animations
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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-skinning-animations .claude/skills/forge-skinning-animations
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでForge Skinning Animationsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にForge Skinning Animationsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Forge Skinning Animationsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Add vertex skinning to an SDL3 GPU scene using skeletal animation data from glTF files. The technique evaluates keyframe channels for translation, rotation (slerp), and scale, rebuilds the joint hierarchy, computes joint matrices (inverse(meshWorld) × jointWorld × inverseBindMatrix), and blends up to 4 joint transforms per vertex in the shader. Use this skill when you need animated characters, creatures, or any mesh that deforms with a skeleton.

See GPU Lesson 32 — Skinning Animations for the full walkthrough.

Key API calls

FunctionPurpose
forge_gltf_load()Load glTF with skins, joints, and animation data
forge_gltf_anim_apply()Evaluate all animation channels at time t
forge_gltf_compute_world_transforms()Propagate local transforms through the node hierarchy
mat4_multiply(a, b)Compose joint matrix: inverse(meshWorld) * jointWorld * inverseBindMatrix
mat4_inverse(m)Compute inverse mesh world for joint matrix formula

Skinned vertex layout

c
typedef struct SkinVertex {
    vec3   position;    /* 12 bytes — FLOAT3   */
    vec3   normal;      /* 12 bytes — FLOAT3   */
    vec2   uv;          /*  8 bytes — FLOAT2   */
    Uint16 joints[4];   /*  8 bytes — USHORT4  */
    float  weights[4];  /* 16 bytes — FLOAT4   */
} SkinVertex;           /* 56 bytes total      */

Pipeline vertex attributes:

  • Location 0: FLOAT3 at offsetof(SkinVertex, position)
  • Location 1: FLOAT3 at offsetof(SkinVertex, normal)
  • Location 2: FLOAT2 at offsetof(SkinVertex, uv)
  • Location 3: USHORT4 at offsetof(SkinVertex, joints)
  • Location 4: FLOAT4 at offsetof(SkinVertex, weights)

Joint matrix computation (per frame)

c
/* Full glTF formula: inverse(meshWorld) * jointWorld * inverseBindMatrix.
 * The inverse mesh world accounts for parent nodes above the mesh
 * (e.g. Z_UP, Armature rotations in CesiumMan). */
mat4 inv_mesh_world = mat4_inverse(mesh_node->world_transform);
for (int i = 0; i < skin->joint_count; i++) {
    int node = skin->joints[i];
    joint_matrices[i] = mat4_multiply(
        inv_mesh_world,
        mat4_multiply(scene.nodes[node].world_transform,
                      skin->inverse_bind_matrices[i]));
}

Shader pattern (vertex)

The vertex shader receives two uniform buffer slots:

  • Slot 0: scene uniforms (MVP, model, light_vp)
  • Slot 1: joint matrices array
hlsl
cbuffer JointUniforms : register(b1, space1)
{
    column_major float4x4 joint_mats[MAX_JOINTS];
};

/* Compute skin matrix from 4 weighted joints */
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 world = mul(skin_mat, float4(input.pos, 1.0));

Animation evaluation

forge_gltf_load() parses all animation channels from the glTF file. At runtime, forge_gltf_anim_apply() handles channel evaluation, then forge_gltf_compute_world_transforms() propagates the hierarchy:

c
#include "gltf/forge_gltf.h"
#include "gltf/forge_gltf_anim.h"

/* Each frame: evaluate channels, rebuild hierarchy, compute joints */
anim_time += dt * ANIM_SPEED;
if (scene.animation_count > 0) {
    forge_gltf_anim_apply(&scene.animations[0],
                          scene.nodes, scene.node_count,
                          anim_time, true);
}

mat4 identity = mat4_identity();
for (int i = 0; i < scene.root_node_count; i++)
    forge_gltf_compute_world_transforms(&scene,
                                        scene.root_nodes[i], &identity);

/* Then compute joint matrices and push to GPU uniform slot 1 */

Pipeline setup

c
/* Skinned vertex shader needs 2 uniform buffers. */
SDL_GPUShaderCreateInfo info;
info.num_uniform_buffers = 2;  /* slot 0: scene, slot 1: joints */

/* Push both uniform slots per draw call. */
SDL_PushGPUVertexUniformData(cmd, 0, &scene_uniforms, sizeof(scene_uniforms));
SDL_PushGPUVertexUniformData(cmd, 1, &joint_uniforms, sizeof(joint_uniforms));

Shadow pass

Use a separate shadow_skin.vert.hlsl that applies the same skin matrix before projecting into light clip space. Both passes share the same joint uniform data — no extra CPU work for skinned shadows.

Common mistakes

  • glTF quaternion order — glTF stores quaternions as [x, y, z, w], but the forge math library uses quat_create(w, x, y, z) with w first. Swapping the order silently produces incorrect rotations.
  • Missing inverse mesh world — The simplified formula world * inverseBindMatrix only works when the mesh node sits at the scene root. The full glTF formula is inverse(meshWorld) * jointWorld * inverseBindMatrix. CesiumMan has Z_UP and Armature parent nodes, so skipping the inverse mesh world produces distorted results.
  • Forgetting shadow skinning — The shadow pass must apply the same skin matrix in its vertex shader. Without this, the shadow stays in the bind pose while the mesh animates.
  • Joint count mismatch — The MAX_JOINTS constant in the shader must match the C-side JointUniforms struct. A mismatch silently corrupts uniform data.
  • Weight normalization — glTF requires weights to sum to 1.0, but some exporters produce slightly denormalized weights. The linear blend still works acceptably, but be aware of this if you see subtle artifacts.

glTF skin data

The forge_gltf.h parser provides:

  • ForgeGltfSkin: joints array, inverse bind matrices, skeleton root
  • ForgeGltfPrimitive: joint_indices (USHORT4), weights (FLOAT4)
  • ForgeGltfNode: skin_index for nodes referencing a skin

Load with forge_gltf_load() — skins are parsed automatically.

よくある質問

AIスキル「Forge Skinning Animations」では何ができますか?

glTFのジョイント階層、逆バインド行列、頂点ごとのブレンドウェイトを使ったスケルタルスキニングアニメーションをSDL GPUプロジェクトに追加します。

TypingMindでForge Skinning Animationsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Forge Skinning Animationsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにForge Skinning Animationsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-skinning-animationsを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Forge Skinning Animationsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Forge Skinning Animationsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもForge Skinning Animationsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Forge Skinning Animations」は無料ですか?

はい。NebulavenusがZlibライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇