Logo: Forge Skinning Animations

Forge Skinning Animations

Communautéit
Nebulavenus
forge-skinning-animations

Füügt engem SDL-GPU-Projet Skelett-Skinning-Animatioune mat glTF-Gelenkhierarchien, Inverse-Bind-Matrizen a Blend-Gewiichter pro Vertex bäi.

Iwwersiicht

EditeurNebulavenus
Repositoryforge-gpu
Skill-Nummforge-skinning-animations
Stären
46
Forks
7
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzZlib
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Nebulavenus huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Forge Skinning Animations an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-skinning-animations
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Forge Skinning Animations an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Forge Skinning Animations automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Forge Skinning Animations net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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.

Heefeg gestallte Froen

Wat mécht de KI-Skill Forge Skinning Animations?

Füügt engem SDL-GPU-Projet Skelett-Skinning-Animatioune mat glTF-Gelenkhierarchien, Inverse-Bind-Matrizen a Blend-Gewiichter pro Vertex bäi.

Firwat Forge Skinning Animations op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Forge Skinning Animations besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Forge Skinning Animations an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/Nebulavenus/forge-gpu/tree/main/.claude/skills/forge-skinning-animations an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Forge Skinning Animations benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Forge Skinning Animations benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Forge Skinning Animations domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Forge Skinning Animations gratis?

Jo. Nebulavenus huet de Skill ënner der Lizenz Zlib op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇