Forge Skinning Animations logo

Forge Skinning Animations

Community
Nebulavenus
forge-skinning-animations

Add skeletal skinning animations with glTF joint hierarchies, inverse bind matrices, and per-vertex blend weights to an SDL GPU project.

Overview

PublisherNebulavenus
Repositoryforge-gpu
Skill nameforge-skinning-animations
Stars
46
Forks
7
Bundled files
Instructions only
LicenseZlib
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by Nebulavenus on GitHub. Read the source before you install it.

Installation

Install the Forge Skinning Animations AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-skinning-animations
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Forge Skinning Animations in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Forge Skinning Animations on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Forge Skinning Animations is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Frequently asked questions

What does the Forge Skinning Animations AI skill do?

Add skeletal skinning animations with glTF joint hierarchies, inverse bind matrices, and per-vertex blend weights to an SDL GPU project.

Why use Forge Skinning Animations on TypingMind?

Because you install it once and use it with any model. Forge Skinning Animations is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Forge Skinning Animations in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-skinning-animations. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Forge Skinning Animations?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Forge Skinning Animations?

As many as you like. As long as a model supports skills, you can use Forge Skinning Animations with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Forge Skinning Animations AI skill free?

Yes. It is published on GitHub by Nebulavenus under the Zlib license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇